Skip to content

Commit

Permalink
Mixer entity corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
KirilKurkianec committed Jan 30, 2024
1 parent d8e633e commit 87ddfbe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion custom_components/econet300/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
DEVICE_INFO_MANUFACTURER = "PLUM"
DEVICE_INFO_MODEL = "ecoNET300"
DEVICE_INFO_CONTROLLER_NAME = "PLUM ecoNET300"
DEVICE_INFO_MIXER_NAME = "Mixer"
DEVICE_INFO_MIXER_NAME = "Mixer device"

CONF_ENTRY_TITLE = "ecoNET300"
CONF_ENTRY_DESCRIPTION = "PLUM Econet300"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/econet300/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def __init__(
def device_info(self) -> DeviceInfo | None:
"""Return device info of the entity."""
return DeviceInfo(
identifiers={(DOMAIN, f"{self.api.uid}-mixer-{self._idx}")},
identifiers={(DOMAIN, f"{self.api.uid}-mixer-device-{self._idx}")},
name=f"{DEVICE_INFO_MIXER_NAME}{self._idx}",
manufacturer=DEVICE_INFO_MANUFACTURER,
model=DEVICE_INFO_MODEL,
Expand Down
8 changes: 4 additions & 4 deletions custom_components/econet300/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ def can_add_mixer(key: str, coordinator: EconetDataCoordinator):


def create_mixer_sensor_entity_description(
key: int, entity_type: str
key: str, entity_type: str
) -> EconetSensorEntityDescription:
"""Create Econect300 mixer sensor entity based on supplied key."""
_LOGGER.debug(
"Creating Mixer entity description for key: %s, and type : %s", key, entity_type
)
entity_description = EconetSensorEntityDescription(
key=str(key),
key=key,
translation_key=camel_to_snake(f"{entity_type}{key}"),
icon=ENTITY_ICON.get(entity_type, None),
native_unit_of_measurement=ENTITY_UNIT_MAP.get(entity_type, None),
Expand All @@ -169,7 +169,7 @@ def create_mixer_sensors(coordinator: EconetDataCoordinator, api: Econet300Api):
)
elif can_add_mixer(mixer_temp_id, coordinator):
mixer_temp_entity = create_mixer_sensor_entity_description(
i, MIXER_AVAILABILITY_KEY
mixer_temp_id, MIXER_AVAILABILITY_KEY
)
entities.append(MixerSensor(mixer_temp_entity, coordinator, api, i))
else:
Expand All @@ -187,7 +187,7 @@ def create_mixer_sensors(coordinator: EconetDataCoordinator, api: Econet300Api):
)
elif can_add_mixer(mixer_set_temp_id, coordinator):
mixer_set_temp_entity = create_mixer_sensor_entity_description(
i, MIXER_SET_TEMP
mixer_set_temp_id, MIXER_SET_TEMP
)
entities.append(MixerSensor(mixer_set_temp_entity, coordinator, api, i))
else:
Expand Down

0 comments on commit 87ddfbe

Please sign in to comment.