diff --git a/custom_components/econet300/binary_sensor.py b/custom_components/econet300/binary_sensor.py index 819da5e..466b898 100644 --- a/custom_components/econet300/binary_sensor.py +++ b/custom_components/econet300/binary_sensor.py @@ -28,7 +28,7 @@ _LOGGER = logging.getLogger(__name__) -@dataclass(frozen=True) +@dataclass class EconetBinarySensorEntityDescription(BinarySensorEntityDescription): """Describes Econet binary sensor entity.""" @@ -58,12 +58,13 @@ def __init__( self.entity_description, ) - def _sync_state(self, value): + def _sync_state(self, value: bool): """Sync state.""" + value = bool(value) _LOGGER.debug("EconetBinarySensor _sync_state: %s", value) self._attr_is_on = value _LOGGER.debug( - "Updated Binary sensor _attr_is_on for %s: %s", + "Updated EconetBinarySensor _attr_is_on for %s: %s", self.entity_description.key, self._attr_is_on, ) @@ -131,7 +132,7 @@ async def async_setup_entry( entry: ConfigEntry, async_add_entities: AddEntitiesCallback, ) -> bool: - """Set up the sensor platform.""" + """Set up the binary sensor platform.""" coordinator = hass.data[DOMAIN][entry.entry_id][SERVICE_COORDINATOR] api = hass.data[DOMAIN][entry.entry_id][SERVICE_API] diff --git a/custom_components/econet300/common.py b/custom_components/econet300/common.py index 6ff15ca..2679d31 100644 --- a/custom_components/econet300/common.py +++ b/custom_components/econet300/common.py @@ -60,7 +60,7 @@ async def _async_update_data(self): try: # Note: asyncio.TimeoutError and aiohttp.ClientError are already # handled by the data update coordinator. - async with asyncio.timeout(20): + async with asyncio.timeout(10): data = await self._api.fetch_sys_params() reg_params = await self._api.fetch_reg_params() params_edits = await self._api.fetch_param_edit_data() diff --git a/custom_components/econet300/const.py b/custom_components/econet300/const.py index 579e63e..3627085 100644 --- a/custom_components/econet300/const.py +++ b/custom_components/econet300/const.py @@ -206,6 +206,7 @@ "tempFeeder": SensorDeviceClass.TEMPERATURE, "tempExternalSensor": SensorDeviceClass.TEMPERATURE, "tempCO": SensorDeviceClass.TEMPERATURE, + "tempCOSet": SensorDeviceClass.TEMPERATURE, "boilerPower": SensorDeviceClass.POWER_FACTOR, "boilerPowerKW": SensorDeviceClass.POWER, "fanPower": SensorDeviceClass.POWER_FACTOR, diff --git a/custom_components/econet300/mem_cache.py b/custom_components/econet300/mem_cache.py index d3bb8cb..3efb70b 100644 --- a/custom_components/econet300/mem_cache.py +++ b/custom_components/econet300/mem_cache.py @@ -47,7 +47,7 @@ def get(self, key): return self._data[key].value() - def set(self, key, value, duration: int = 60): + def set(self, key, value, duration: int = 30): """Set the value of the specified key in the cache.""" _LOGGER.debug("Caching value for: '%s'", key) self._data[key] = MemCacheItem(key, value, duration) diff --git a/custom_components/econet300/strings.json b/custom_components/econet300/strings.json index f8fd89c..7601906 100644 --- a/custom_components/econet300/strings.json +++ b/custom_components/econet300/strings.json @@ -29,9 +29,6 @@ "unseal": { "name": "Unseal" }, - "thermostat": { - "name": "Boiler thermostat" - }, "pump_co_works": { "name": "Pump CO" }, @@ -44,12 +41,12 @@ "additional_feeder": { "name": "Additional feeder" }, - "pump_fireplace_works": { - "name": "Boiler Pump" - }, "pump_cwu_works": { "name": "Pump CWU" }, + "pump_fireplace_works": { + "name": "Boiler pump" + }, "mixer_pump1": { "name": "Mixer 1 pump" }, @@ -159,15 +156,6 @@ "mixer_set_temp1": { "name": "Mixer target temperature" }, - "pump_cwu_works": { - "name": "HUW pump" - }, - "status_cwu": { - "name": "Water heater status" - }, - "pump_fireplace_works": { - "name": "Boiler pump" - }, "quality": { "name": "Signal quality" }, @@ -183,6 +171,12 @@ "temp_cwu": { "name": "Water heater temperature" }, + "status_cwu": { + "name": "Water heater status" + }, + "temp_cwu_set": { + "name": "Water heater set temperature" + }, "temp_upper_buffer": { "name": "Upper buffer temperature" }, diff --git a/custom_components/econet300/translations/en.json b/custom_components/econet300/translations/en.json index ef135bf..78d53ad 100644 --- a/custom_components/econet300/translations/en.json +++ b/custom_components/econet300/translations/en.json @@ -29,15 +29,15 @@ "unseal": { "name": "Unseal" }, - "thermostat": { - "name": "Boiler thermostat" - }, "pump_co_works": { "name": "Pump CO" }, "fan_works": { "name": "Fan" }, + "feeder_works": { + "name": "Feeder" + }, "additional_feeder": { "name": "Additional feeder" }, @@ -106,9 +106,6 @@ "feeder_work": { "name": "Feeder work" }, - "feeder_works": { - "name": "Feeder" - }, "firing_up_count": { "name": "Firing up count" }, @@ -138,15 +135,9 @@ "mixer_set_temp1": { "name": "Mixer target temperature" }, - "pump_cwu_works": { - "name": "HUW pump" - }, "status_cwu": { "name": "Water heater status" }, - "pump_fireplace_works": { - "name": "Boiler pump" - }, "quality": { "name": "Signal quality" }, @@ -183,6 +174,9 @@ "temp_cwu": { "name": "Water heater temperature" }, + "temp_cwu_set": { + "name": "Water heater set temperature" + }, "temp_upper_buffer": { "name": "Upper buffer temperature" }, diff --git a/custom_components/econet300/translations/pl.json b/custom_components/econet300/translations/pl.json index bc30b98..64c9f78 100644 --- a/custom_components/econet300/translations/pl.json +++ b/custom_components/econet300/translations/pl.json @@ -26,9 +26,6 @@ "unseal": { "name": "Unseal" }, - "thermostat": { - "name": "Boiler thermostat" - }, "pump_co_works": { "name": "Pump CO" }, @@ -38,9 +35,6 @@ "aditional_feeder": { "name": "Aditional feeder" }, - "pump_fireplace_works": { - "name": "Boiler Pump" - }, "pump_cwu_works": { "name": "Pump CWU" }, @@ -50,6 +44,9 @@ "boiler_pump": { "name": "Boiler pump" }, + "pump_fireplace_works": { + "name": "Boiler pump" + }, "main_srv": { "name": "Econet24.com server" }, @@ -113,12 +110,6 @@ "unknown": "Unknown" } }, - "pump_cwu_works": { - "name": "HUW pump" - }, - "pump_fireplace_works": { - "name": "Boiler pump" - }, "valve_mixer1": { "name": "Zawór mieszacza 1" },