Skip to content

Automated Protos Update: Python wrappers - #1315

Merged
Naveed Jooma (njooma) merged 2 commits into
workflow/update-protofrom
workflow/update-proto-ai
Nov 23, 2026
Merged

Naveed Jooma (njooma) merged 2 commits into
workflow/update-protofrom
workflow/update-proto-ai

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

This is an auto-generated PR updating the Python wrappers for the proto changes in #1311.

This PR is stacked on top of workflow/update-proto. Review and merge #1311 first; this PR will retarget to main automatically.

@github-actions
github-actions Bot requested a review from a team as a code owner November 23, 2026 19:00
@github-actions
github-actions Bot requested review from nandini-swami and Naveed Jooma (njooma) and removed request for a team November 23, 2026 19:00
Comment on lines +11 to +14
@dataclass
class Properties:
is_battery_percent_supported: bool

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude (@claude) make Properties a typealias to GetPropertiesResponse (similar to how we do it for camera)

@claude claude Bot Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude finished Naveed Jooma (@njooma)'s task in 2m 40s —— View job


Tasks

  • Gather context (read camera pattern, read power_sensor files)
  • Update power_sensor.py: add TypeAlias, import GetPropertiesResponse, replace dataclass with type alias, fix docstring placement
  • Update client.py: simplify get_properties to return proto response directly
  • Update service.py: send properties directly without reconstructing GetPropertiesResponse
  • Format and lint
  • Commit and push

Done. Changes made in 3aef705:

  • power_sensor.py: Removed the @dataclass class Properties and replaced with Properties: "TypeAlias" = GetPropertiesResponse (matching the camera pattern). Also fixed the misplaced class docstring (it was after the dataclass, so not actually the class docstring).
  • client.py: get_properties now returns the proto response directly instead of constructing a PowerSensor.Properties dataclass wrapper.
  • service.py: GetProperties now sends properties directly to the stream instead of doing GetPropertiesResponse(**properties.__dict__) (which is unnecessary now that the return type is already a GetPropertiesResponse).

The mock and tests required no changes — PowerSensor.Properties(is_battery_percent_supported=True) now calls GetPropertiesResponse(is_battery_percent_supported=True), which is valid, and test assertions on .is_battery_percent_supported still work.

Co-authored-by: Naveed Jooma <njooma@users.noreply.github.com>
@njooma
Naveed Jooma (njooma) merged commit a98ec40 into workflow/update-proto Nov 23, 2026
1 check passed
@njooma
Naveed Jooma (njooma) deleted the workflow/update-proto-ai branch November 23, 2026 19:12
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