Skip to content

Device Property Decorators#137

Open
youneedgreg wants to merge 5 commits intogoogle:copybara_pushfrom
youneedgreg:Device-Properties
Open

Device Property Decorators#137
youneedgreg wants to merge 5 commits intogoogle:copybara_pushfrom
youneedgreg:Device-Properties

Conversation

@youneedgreg
Copy link

Fixes #135

  1. Added @Property decorators to methods requested in SmartDevice.
  2. Updated all code and test references to use attribute access (e.g., device.device_id instead of device.device_id()).
  3. Searched and replaced all usages across the codebase, including:
  • simulator.py
  • simulator_building.py
  • simulator_flexible_floor_plan.py

All relevant test files
Note: No changes were made for device_filepath as it was not found in the codebase.

@google-cla
Copy link

google-cla bot commented Dec 30, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@s2t2 s2t2 self-requested a review January 22, 2026 16:15
Copy link
Collaborator

@s2t2 s2t2 left a comment

Choose a reason for hiding this comment

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

Hi @youneedgreg thanks for the PR! this looks generally good.

I just have two minor questions about formatting.

'supply_water_setpoint',
'supply_water_temperature_sensor',
'heating_request_count',
],
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm curious, were these indentation changes made by the auto-formatter during pre-commit hooks? Or are these indentation changes made manually?

Can you please confirm if you have installed pre-commit hooks?
https://google.github.io/sbsim/contributing/#pre-commit-hooks

If our auto-formatter is responsible, we will want to update it (in a separate issue / PR) to use a hanging indentation of four spaces (to match Google internal style rules).

Copy link
Author

Choose a reason for hiding this comment

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

The indentation changes were made manually as pre-commit hooks were not installed locally. I've confirmed the code uses 4-space hanging indentation, which aligns with the Google style guide.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK, I saw those manual indentation changes were still in place, so I just restored the hanging indentation to use four spaces.

@s2t2 s2t2 changed the title Refactor device property accessors to use properties instead of methods Device Property Decorators Jan 26, 2026
@s2t2 s2t2 self-requested a review January 26, 2026 16:29
Copy link
Collaborator

@s2t2 s2t2 left a comment

Choose a reason for hiding this comment

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

@youneedgreg thanks for your reply, and for making those updates. I saw the device_type method is still lacking a property decorator, so if you could please implement that, then this PR will be ready for merge!

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.

Device Properties

2 participants