-
-
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
Migrate Tile to use entry.runtime_data #134107
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
|
@@ -26,6 +32,7 @@ def __init__(self, hass: HomeAssistant, client: API, tile: Tile) -> None: | |||
) | |||
self.tile = tile | |||
self.client = client | |||
self.username = self.config_entry.data[CONF_USERNAME] |
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 necessary?
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.
Because I don't really feel like doing coordinator.config_entry.data[CONF_USERNAME]
in the unique id attribute and this makes it a bit shorter
hass.data[DOMAIN].pop(entry.entry_id) | ||
|
||
return unload_ok | ||
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS) |
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.
Does entry_data
allow this to be removed?
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.
That happens automatically :D
# Conflicts: # homeassistant/components/tile/device_tracker.py # tests/components/tile/test_config_flow.py
|
||
class TileCoordinator(DataUpdateCoordinator[None]): | ||
"""Define an object to coordinate Tile data retrieval.""" | ||
|
||
config_entry: TileConfigEntry | ||
|
||
def __init__(self, hass: HomeAssistant, client: API, tile: Tile) -> 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.
can we also pass the entry
?
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Proposed change
Migrate Tile to use entry.runtime_data
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: