Skip to content

Commit

Permalink
Minor Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KirilKurkianec committed Jan 15, 2024
1 parent d24822b commit fc98ade
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 5 additions & 7 deletions custom_components/econet300/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ def create_mixer_sensors(coordinator: EconetDataCoordinator, api: Econet300Api):
entities = []

for i in range(1, AVAILABLE_NUMBER_OF_MIXERS + 1):
availaimility_mixer_key = f"mixerTemp{i}"
if can_add_mixer(availaimility_mixer_key, coordinator):
availability_mixer_key = f"mixerTemp{i}"
if can_add_mixer(availability_mixer_key, coordinator):
description = EconetBinarySensorEntityDescription(
availability_key=availaimility_mixer_key,
availability_key=availability_mixer_key,
key=f"mixerPumpWorks{i}",
name=f"Mixer {i}",
icon="mdi:pump",
Expand All @@ -154,10 +154,8 @@ def create_mixer_sensors(coordinator: EconetDataCoordinator, api: Econet300Api):
entities.append(MixerBinarySensor(description, coordinator, api, i))
else:
_LOGGER.debug(
"Availability key: "
+ description.key
+ " does not exist, entity will not be "
"added"
"Availability key: %s does not exist, entity will not be added",
availability_mixer_key,
)

return entities
Expand Down
6 changes: 5 additions & 1 deletion custom_components/econet300/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
SensorEntity,
SensorEntityDescription,
SensorStateClass,
SensorDeviceClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.const import (
UnitOfTemperature,
)

from .common import Econet300Api, EconetDataCoordinator
from .common_functions import camel_to_snake
Expand Down Expand Up @@ -137,7 +141,7 @@ def can_add(desc: EconetSensorEntityDescription, coordinator: EconetDataCoordina

def create_mixer_sensors(coordinator: EconetDataCoordinator, api: Econet300Api):
"""Create individual sensor descriptions for mixer sensors."""
entities = []
entities: list[MixerSensor] = []

for i in range(1, AVAILABLE_NUMBER_OF_MIXERS + 1):
description = EconetSensorEntityDescription(
Expand Down

0 comments on commit fc98ade

Please sign in to comment.