-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add number platform to Matter integration #119770
Add number platform to Matter integration #119770
Conversation
Add support for setting of the LevelControl transition attributes: OnLevel, OnTransitionTime, OffTransitionTime, OnOffTransitionTime (if present)
Hey there @home-assistant/matter, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jvmahon !
Writing the null value to attributes is not working yet (to reset the value) but that is a bug server side: home-assistant-libs/python-matter-server#768 |
I think there is also an issue (more of a "feature request") on the core Number entity (https://developers.home-assistant.io/docs/core/entity/number) which does not allow entering a null in the BOX entry type. At least I think it doesn't. There's probably a need for a feature request to allow an "is_nullable" type flag allowing the entry box to be empty so it reports a null (which can then be written to the nullable Matter attribute when writing nulls if fixed). |
For now I have solve dit by allowing 255 as value, just like the other integrations handle it (zigbee, zwave) |
Oh and yeah, I agree that we should have a "nullable" feature on the select platform. Lets add an architecture discussion for that (if there is not yet one already) |
Co-authored-by: Franck Nijhof <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code coverage job failed correctly and should have blocked this from merging.
async def async_set_native_value(self, value: float) -> None: | ||
"""Update the current value.""" | ||
matter_attribute = self._entity_info.primary_attribute | ||
sendvalue = int(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please separate words with underscore, send_value
.
|
||
state = hass.states.get("number.mock_dimmable_light_on_level") | ||
assert state | ||
assert state.state == "20" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to test the set value service of the number entity too.
Proposed change
Add base support for the number platform to the Matter integration.
Adds support to set the LevelControl transition attributes: OnLevel, OnTransitionTime, OffTransitionTime, OnOffTransitionTime (if present) to the discovery schemas of the number platform, marked as CONFIG entities.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: