Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 1 addition & 3 deletions homeassistant/components/lifx/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

HEV_CYCLE_STATE_SENSOR = BinarySensorEntityDescription(
key=HEV_CYCLE_STATE,
name="Clean Cycle",
translation_key="clean_cycle",
entity_category=EntityCategory.DIAGNOSTIC,
device_class=BinarySensorDeviceClass.RUNNING,
)
Expand All @@ -39,8 +39,6 @@ async def async_setup_entry(
class LIFXHevCycleBinarySensorEntity(LIFXEntity, BinarySensorEntity):
"""LIFX HEV cycle state binary sensor."""

_attr_has_entity_name = True

def __init__(
self,
coordinator: LIFXUpdateCoordinator,
Expand Down
4 changes: 1 addition & 3 deletions homeassistant/components/lifx/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

RESTART_BUTTON_DESCRIPTION = ButtonEntityDescription(
key=RESTART,
name="Restart",
device_class=ButtonDeviceClass.RESTART,
entity_category=EntityCategory.CONFIG,
)
Expand Down Expand Up @@ -45,8 +44,7 @@ async def async_setup_entry(
class LIFXButton(LIFXEntity, ButtonEntity):
"""Base LIFX button."""

_attr_has_entity_name: bool = True
_attr_should_poll: bool = False
_attr_should_poll = False

def __init__(self, coordinator: LIFXUpdateCoordinator) -> None:
"""Initialise a LIFX button."""
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/lifx/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
class LIFXEntity(CoordinatorEntity[LIFXUpdateCoordinator]):
"""Representation of a LIFX entity with a coordinator."""

_attr_has_entity_name = True

def __init__(self, coordinator: LIFXUpdateCoordinator) -> None:
"""Initialise the light."""
super().__init__(coordinator)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/lifx/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class LIFXLight(LIFXEntity, LightEntity):
"""Representation of a LIFX light."""

_attr_supported_features = LightEntityFeature.TRANSITION | LightEntityFeature.EFFECT
_attr_name = None

def __init__(
self,
Expand All @@ -131,7 +132,6 @@ def __init__(
self.postponed_update: CALLBACK_TYPE | None = None
self.entry = entry
self._attr_unique_id = self.coordinator.serial_number
self._attr_name = self.bulb.label
self._attr_min_color_temp_kelvin = bulb_features["min_kelvin"]
self._attr_max_color_temp_kelvin = bulb_features["max_kelvin"]
if bulb_features["min_kelvin"] != bulb_features["max_kelvin"]:
Expand Down
8 changes: 2 additions & 6 deletions homeassistant/components/lifx/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@

INFRARED_BRIGHTNESS_ENTITY = SelectEntityDescription(
key=INFRARED_BRIGHTNESS,
name="Infrared brightness",
translation_key="infrared_brightness",
entity_category=EntityCategory.CONFIG,
options=list(INFRARED_BRIGHTNESS_VALUES_MAP.values()),
)

THEME_ENTITY = SelectEntityDescription(
key=ATTR_THEME,
name="Theme",
translation_key="theme",
entity_category=EntityCategory.CONFIG,
options=THEME_NAMES,
)
Expand Down Expand Up @@ -58,8 +58,6 @@ async def async_setup_entry(
class LIFXInfraredBrightnessSelectEntity(LIFXEntity, SelectEntity):
"""LIFX Nightvision infrared brightness configuration entity."""

_attr_has_entity_name = True

def __init__(
self,
coordinator: LIFXUpdateCoordinator,
Expand Down Expand Up @@ -90,8 +88,6 @@ async def async_select_option(self, option: str) -> None:
class LIFXThemeSelectEntity(LIFXEntity, SelectEntity):
"""Theme entity for LIFX multizone devices."""

_attr_has_entity_name = True

def __init__(
self,
coordinator: LIFXUpdateCoordinator,
Expand Down
4 changes: 1 addition & 3 deletions homeassistant/components/lifx/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

RSSI_SENSOR = SensorEntityDescription(
key=ATTR_RSSI,
name="RSSI",
translation_key="rssi",
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.MEASUREMENT,
Expand All @@ -41,8 +41,6 @@ async def async_setup_entry(
class LIFXRssiSensor(LIFXEntity, SensorEntity):
"""LIFX RSSI sensor."""

_attr_has_entity_name = True

def __init__(
self,
coordinator: LIFXUpdateCoordinator,
Expand Down
20 changes: 20 additions & 0 deletions homeassistant/components/lifx/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,25 @@
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]",
"no_devices_found": "[%key:common::config_flow::abort::no_devices_found%]"
}
},
"entity": {
"binary_sensor": {
"clean_cycle": {
"name": "Clean cycle"
}
},
"select": {
"infrared_brightness": {
"name": "Infrared brightness"
},
"theme": {
"name": "Theme"
}
},
"sensor": {
"rssi": {
"name": "RSSI"
}
}
}
}