Skip to content

Fix incorrect return type annotations in base_api#153

Open
johanzander wants to merge 2 commits into
indykoning:masterfrom
johanzander:fix/plant-list-return-type
Open

Fix incorrect return type annotations in base_api#153
johanzander wants to merge 2 commits into
indykoning:masterfrom
johanzander:fix/plant-list-return-type

Conversation

@johanzander
Copy link
Copy Markdown
Collaborator

@johanzander johanzander commented Jun 7, 2026

Summary

  • Fix plant_list return type from list[dict[str, Any]] to dict[str, Any] — it returns a dict with data and totalData keys
  • Fix __get_all_devices return type from dict[str, Any] to list[dict[str, Any]] and default from {} to [] — it returns a list of devices

Context

Confirmed by existing examples:

  • noah_example.py accesses plant_list["data"] and plant_list["totalData"] (dict, not list)
  • tlx_example.py iterates for device in devices: directly over device_list() result (list, not dict)

Test plan

  • Verify TLX/MIN examples still work
  • Type checker passes

🤖 Generated with Claude Code

johanzander and others added 2 commits June 7, 2026 20:19
The method returns a dict (with 'data' and 'totalData' keys) from the
API's "back" field, not a list. The annotation incorrectly stated
list[dict[str, Any]].

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The method returns a list of devices (confirmed by TLX examples iterating
over the result), not a dict. Fix annotation to list[dict[str, Any]] and
default from {} to [].

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@johanzander johanzander changed the title Fix incorrect return type annotation for plant_list Fix incorrect return type annotations in base_api Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant