-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
Matter TemperatureLevel feature from TemperatureControl cluster #134532
base: dev
Are you sure you want to change the base?
Conversation
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
|
@@ -111,6 +111,35 @@ def _update_from_device(self) -> None: | |||
self._attr_name = desc | |||
|
|||
|
|||
class MatterLevelSelectEntity(MatterSelectEntity): |
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.
I think we can further generalize this one.
In essence its executing a command with a value.
So we can have a schema that takes the command
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.
I haven't figured out how to make the command argument generic. When the command is called, the variable name is used, not its value.
Do you have a suggestion?
Error: homeassistant/components/matter/select.py:130: error: Unexpected keyword argument "targetTemperatureLevel" [call-arg] Error: homeassistant/components/matter/select.py:130: error: "None" not callable [misc]
@property | ||
def secondary_attribute(self) -> type[ClusterAttributeDescriptor]: | ||
"""Return Secondary Attribute belonging to the entity.""" | ||
return self.attributes_to_watch[1] | ||
|
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.
this is dangerous - lets not do this
select_list = self.get_matter_attribute_value( | ||
self._entity_info.secondary_attribute | ||
) |
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 use a local attribute here to get the SupportedTemperatureLevels attribute value
key="TemperatureControlSelectedTemperatureLevel", | ||
translation_key="temperature_level", | ||
command=clusters.TemperatureControl.Commands.SetTemperature, | ||
# field=clusters.TemperatureControl.Commands.SetTemperature.targetTemperatureLevel, |
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.
whats this ?
"""Change the selected option.""" | ||
# select the ID from the label string | ||
option_id = self._attr_options.index(option) | ||
# field = self.entity_description.field |
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.
?
@@ -46,6 +47,9 @@ async def async_setup_entry( | |||
class MatterSelectEntityDescription(SelectEntityDescription, MatterEntityDescription): | |||
"""Describe Matter select entities.""" | |||
|
|||
command: Callable[[], Any] | None = None | |||
field: str | None = None |
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.
Is this leftover ?
Proposed change
Add support for
TemperatureLevel
feature from Matter Temperature Control Cluster (0x0056) used in the following device types:You can select the Temperature Level from a select list.
TemperatureLevel feature:
For devices that use vendor-specific temperature levels for the temperature setpoint, such as some washers (Dishwasher, LaundryDryer, LaundryWasher)
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
.To help with the load of incoming pull requests: