Skip to content

Commit

Permalink
add EN translations and debug lines fo binary sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
jontofront committed Dec 22, 2023
1 parent 7f6da23 commit d7ecbdc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
17 changes: 9 additions & 8 deletions custom_components/econet300/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class EconetBinarySensorEntityDescription(BinarySensorEntityDescription):
"""Describes Econet binary sensor entity."""

icon_off: str | None = None
availability_key: str = ""


class EconetBinarySensor(EconetEntity, BinarySensorEntity):
Expand Down Expand Up @@ -92,24 +93,24 @@ def create_binary_sensors(coordinator: EconetDataCoordinator, api: Econet300Api)
_LOGGER.debug("Entering create_binary_sensors function")
_LOGGER.debug("api: %s", api)
entities: list[EconetBinarySensor] = []
_LOGGER.debug("create_binary_sensors")
_LOGGER.debug("Initialized entities list: %s", entities)
coordinator = coordinator.data
_LOGGER.debug("coordinator: %s", coordinator)
_LOGGER.debug("Updated coordinator with its data: %s", coordinator)
for data_key in BINARY_SENSOR_MAP:
_LOGGER.debug("data_key: %s", data_key)
_LOGGER.debug("Processing data_key: %s", data_key)
if data_key in BINARY_SENSOR_MAP:
entities.append(
EconetBinarySensor(
create_binary_entity_descritpion(data_key), coordinator, api
)
entity = EconetBinarySensor(
create_binary_entity_descritpion(data_key), coordinator, api
)
entities.append(entity)
_LOGGER.debug("Created and appended entity: %s", entity)
_LOGGER.debug("Key: %s mapped, binary entity will be added", data_key)
else:
_LOGGER.debug(
"key: %s is not mapped, binary sensor entity will not be added",
data_key,
)

_LOGGER.debug("Exiting create_binary_sensors function with entities: %s", entities)
return entities


Expand Down
8 changes: 8 additions & 0 deletions custom_components/econet300/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
},
"entity": {
"binary_sensor": {
"weather_control": {"name": "Weather control the boiler"},
"unseal": { "name": "Unseal" },
"thermostat": { "name": "Boiler thermostat" },
"pump_co_works": { "name": "Pump CO" },
"fan_works": { "name": "Fan" },
"aditional_feeder": { "name": "Aditional feeder" },
"pump_fireplace_works": { "name": "Boiler Pump" },
"pump_cwu_works": { "name": "Pump CWU" },
"mixer_pump1": { "name": "Mixer 1 pump" },
"boiler_pump": { "name": "Boiler pump" }
},
Expand Down
10 changes: 9 additions & 1 deletion custom_components/econet300/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
},
"entity": {
"binary_sensor": {
"weather_control": {"name": "Weather control the boiler"},
"unseal": { "name": "Unseal" },
"thermostat": { "name": "Boiler thermostat" },
"pump_co_works": { "name": "Pump CO" },
"fan_works": { "name": "Fan" },
"aditional_feeder": { "name": "Aditional feeder" },
"pump_fireplace_works": { "name": "Boiler Pump" },
"pump_cwu_works": { "name": "Pump CWU" },
"mixer_pump1": { "name": "Mixer 1 pump" },
"boiler_pump": { "name": "Boiler pump" }
},
Expand Down Expand Up @@ -54,4 +62,4 @@
"weather_control": {"name": "Weather control the boiler"}
}
}
}
}

0 comments on commit d7ecbdc

Please sign in to comment.