-
-
Notifications
You must be signed in to change notification settings - Fork 28.9k
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 Matter update entities for devices with OTA requestor #120304
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
|
Matter devices which support the OTA requestor cluster can receive updates from a OTA provider. The Home Assistant Python Matter Server implements such an OTA provider now. Add update entities for devices which support the OTA requestor cluster and check for available updates. Allow the user to update the firmware. The update progress will be read directly from the devices' OTA requestor cluster.
62eee47
to
a8ce2f5
Compare
from .helpers import get_matter | ||
from .models import MatterDiscoverySchema | ||
|
||
SCAN_INTERVAL = timedelta(hours=12) |
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'm surprised by this combined with should_poll
not being overridden in the update entity class.
Is the matter
integration polled?
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.
No, the Matter integration is not polled.
But checking for updates is. The device don't have a bulit-in update checking mechanism, so we don't get a notification pushed when there is an update.
We could do the polling on Matter Server side. But it feels more naturally to use Core's polling capability. With this, one can also use the homeassistant.update_entity
service to force an update check.
else: | ||
self._attr_in_progress = True | ||
|
||
async def async_update(self) -> 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.
Why does this method not just call self._update_from_device
?
@property | ||
def entity_picture(self) -> str | None: | ||
"""Return the entity picture to use in the frontend.""" | ||
|
||
# The Matter brand picture is not appropriate as this is the update | ||
# entity for the device. | ||
return 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.
What sets the entity picture in other matter entities?
raise HomeAssistantError("No software version specified") | ||
|
||
self._attr_in_progress = True | ||
self.async_write_ha_state() |
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.
Why is this needed? If the entity is polled, an update should be scheduled after service calls
Co-authored-by: Erik Montnemery <[email protected]>
Co-authored-by: Erik Montnemery <[email protected]>
Breaking change
Proposed change
Matter devices which support the OTA requestor cluster can receive updates from a OTA provider. The Home Assistant Python Matter Server implements such an OTA provider now.
Add update entities for devices which support the OTA requestor cluster and check for available updates. Allow the user to update the firmware. The update progress will be read directly from the devices' OTA requestor cluster.
Related Python Matter Server PR: home-assistant-libs/python-matter-server#709
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: