mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 07:37:34 +00:00
address review comments
This commit is contained in:
parent
bd7377bddf
commit
d25887b8e5
@ -14,7 +14,7 @@ from homeassistant.components.switch import (
|
||||
)
|
||||
from homeassistant.const import EntityCategory
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
|
||||
|
||||
from . import HomeeConfigEntry
|
||||
from .const import CLIMATE_PROFILES, LIGHT_PROFILES
|
||||
@ -65,9 +65,9 @@ SWITCH_DESCRIPTIONS: dict[AttributeType, HomeeSwitchEntityDescription] = {
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
config_entry: HomeeConfigEntry,
|
||||
async_add_devices: AddEntitiesCallback,
|
||||
async_add_devices: AddConfigEntryEntitiesCallback,
|
||||
) -> None:
|
||||
"""Add the Homee platform for the switch component."""
|
||||
"""Setups the switch platform for the Homee component."""
|
||||
|
||||
for node in config_entry.runtime_data.nodes:
|
||||
async_add_devices(
|
||||
@ -99,7 +99,7 @@ class HomeeSwitch(HomeeEntity, SwitchEntity):
|
||||
"""Initialize a Homee switch entity."""
|
||||
super().__init__(attribute, entry)
|
||||
self.entity_description = description
|
||||
if not ((attribute.type == AttributeType.ON_OFF) and (attribute.instance == 0)):
|
||||
if not (attribute.type == AttributeType.ON_OFF and attribute.instance == 0):
|
||||
self._attr_translation_key = description.key
|
||||
if attribute.instance > 0:
|
||||
self._attr_translation_key = f"{description.key}_instance"
|
||||
|
Loading…
x
Reference in New Issue
Block a user