-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
Introduce base entity for Tile #134109
Introduce base entity for Tile #134109
Conversation
Hey there @bachya, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
# Conflicts: # homeassistant/components/tile/device_tracker.py
@@ -59,16 +57,6 @@ def __init__(self, entry: ConfigEntry, coordinator: TileCoordinator) -> None: | |||
self._attr_unique_id = f"{entry.data[CONF_USERNAME]}_{self._tile.uuid}" | |||
self._entry = entry |
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.
It doesn't look like it's even used so maybe we can remove (or at least replace with self.coordinator.config_entry
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.
Also remove self._tile
on line 56 since it's in the base entity as well.
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.
Oh I already removed it in #134107
def device_info(self) -> DeviceInfo: | ||
"""Return device info.""" | ||
return DeviceInfo(identifiers={(DOMAIN, self._tile.uuid)}, name=self._tile.name) | ||
|
||
@callback |
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 move _handle_coordinator_update()
also to the base entity and an abstract _update_from_latest_data()
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 want to implement other platforms like binary, but they will not use the _handle_coordinator_update()
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 would assume they would also use the coordinator but if that's not the case let's leave it then 👍
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.
Oh they will use the coordinator, but they won't use a separate function to set the state
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Proposed change
Introduce base entity for Tile
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: