-
-
Notifications
You must be signed in to change notification settings - Fork 37.5k
Use config entry title for Avea light #170978
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,7 +84,7 @@ async def async_setup_entry( | |
| async_add_entities: AddConfigEntryEntitiesCallback, | ||
| ) -> None: | ||
| """Set up the Avea light platform.""" | ||
| async_add_entities([AveaLight(entry.runtime_data)], update_before_add=True) | ||
| async_add_entities([AveaLight(entry.runtime_data, entry)], update_before_add=True) | ||
|
|
||
|
|
||
| def _discover_bulbs_for_import() -> list[dict[str, str]]: | ||
|
|
@@ -169,10 +169,10 @@ class AveaLight(LightEntity): | |
| _attr_color_mode = ColorMode.HS | ||
| _attr_supported_color_modes = {ColorMode.HS} | ||
|
|
||
| def __init__(self, light: avea.Bulb) -> None: | ||
| def __init__(self, light: avea.Bulb, entry: AveaConfigEntry) -> None: | ||
| """Initialize an AveaLight.""" | ||
| self._light = light | ||
| self._attr_name = light.name | ||
| self._attr_name = entry.title | ||
|
pattyland marked this conversation as resolved.
Outdated
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’m keeping this PR limited to the regression fix for entities being created from the library default name "Unknown". Moving Avea to device/entity naming with device_info would be a broader metadata change and is better handled separately once we have the right device identifiers. |
||
| self._attr_brightness = light.brightness | ||
|
|
||
| def turn_on(self, **kwargs: Any) -> None: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.