Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions homeassistant/components/avea/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ 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.title)], update_before_add=True
)


def _discover_bulbs_for_import() -> list[dict[str, str]]:
Expand Down Expand Up @@ -169,10 +171,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, name: str) -> None:
"""Initialize an AveaLight."""
self._light = light
self._attr_name = light.name
self._attr_name = name
Comment thread
pattyland marked this conversation as resolved.
Outdated
self._attr_brightness = light.brightness

def turn_on(self, **kwargs: Any) -> None:
Expand Down
4 changes: 1 addition & 3 deletions tests/components/avea/test_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
)
from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er

from . import AVEA_DISCOVERY_INFO

Expand All @@ -26,7 +25,7 @@
def mock_bulb() -> MagicMock:
"""Return a mocked Avea bulb."""
bulb = MagicMock()
bulb.name = "Bedroom"
bulb.name = "Unknown"
Comment thread
pattyland marked this conversation as resolved.
bulb.brightness = 0
bulb.get_brightness.return_value = 0
return bulb
Expand Down Expand Up @@ -54,7 +53,6 @@ async def setup_integration(

async def test_init_state(
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
setup_integration: MagicMock,
) -> None:
"""Test the initial state."""
Expand Down