Skip to content

Commit

Permalink
Merge pull request #44 from denpaforks/dev-1.0.0-beta
Browse files Browse the repository at this point in the history
Fix translations
  • Loading branch information
jontofront authored Dec 20, 2023
2 parents 7de6868 + 67cb370 commit 0a54d09
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 85 deletions.
4 changes: 2 additions & 2 deletions custom_components/econet300/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class EconetBinarySensorEntityDescription(BinarySensorEntityDescription):
BINARY_SENSOR_TYPES: tuple[EconetBinarySensorEntityDescription, ...] = (
EconetBinarySensorEntityDescription(
key="1544",
name="Pump mixer 1",
translation_key="mixer_pump1",
icon="mdi:pump",
icon_off="mdi:pump-off",
device_class=BinarySensorDeviceClass.RUNNING,
),
EconetBinarySensorEntityDescription(
key="1541",
name="Boiler pump",
translation_key="boiler_pump",
icon="mdi:pump",
icon_off="mdi:pump-off",
device_class=BinarySensorDeviceClass.RUNNING,
Expand Down
6 changes: 1 addition & 5 deletions custom_components/econet300/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ def __init__(self, entity_description, name, unique_id):
super().__init__(name=name, unique_id=unique_id)
self.entity_description = entity_description
self._attr_native_value = None
@property
def name(self):
"""Return the localized name of the sensor."""
return self.hass.localize(f"econet300.entity.sensor.{self.entity_description.name}")

def _sync_state(self, value):
"""Sync state"""
Expand Down Expand Up @@ -80,7 +76,7 @@ def create_entity_description(key: str):
map_key = REG_PARAM_MAP.get(key, key)
return EconetSensorEntityDescription(
key=key,
name=camel_to_snake(map_key),
translation_key=camel_to_snake(map_key),
native_unit_of_measurement=REG_PARAM_UNIT.get(map_key, None),
state_class=REG_PARAM_STATE_CLASS.get(map_key, None),
device_class=REG_PARAM_DEVICE_CLASS.get(map_key, None),
Expand Down
43 changes: 23 additions & 20 deletions custom_components/econet300/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,31 @@
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
}
},
"entity":{
"entity": {
"binary_sensor": {
"mixer_pump1": { "name": "Mixer 1 pump" },
"boiler_pump": { "name": "Boiler pump" }
},
"sensor": {
"boiler_power": { "name": "Boiler poweer stringas cia" },
"boiler_power": { "name": "Boiler power" },
"temp_external_sensor": { "name": "Outside temperature" },
"temp_feeder": {"name": "Feeder temperature"},
"fuel_fevel": { "name": "fuel Level" },
"ther_mostat": { "name": "thermostat" },
"lambda_status": { "name": "lambda Status" },
"lambda_set": { "name": "lambda Set" },
"lambda_level": { "name": "lambda Level" },
"signal": { "name": "signaliukas" },
"temp_c": { "name": "tempCOukas" },
"temp_cwu": { "name": "tempCWUiukas" },
"temp_upper_buffer": { "name": "tempUpper Buffer" },
"temp_lower_buffer": { "name": "tempLower Buffer" },
"temp_flue_gas": { "name": "temp Flue Gas" },
"mixer_temp1": { "name": "mixer Temp1" },
"mixer_set_temp1": { "name": "mixer SetT emp1" },
"mode": { "name": "Modukas" },
"fan_power": { "name": "fanPoweriukas" },
"temp_co_set": { "name": "tempCOSetukas" }
}
"fuel_level": { "name": "Fuel level" },
"thermostat": { "name": "Thermostat" },
"lambda_status": { "name": "Lambda status" },
"lambda_set": { "name": "Lambda set" },
"lambda_level": { "name": "Lambda level" },
"signal": { "name": "Signal quality" },
"temp_co": { "name": "Heating temperature" },
"temp_cwu": { "name": "Water heater temperature" },
"temp_upper_buffer": { "name": "Upper buffer temperature" },
"temp_lower_buffer": { "name": "Lower buffer temperature" },
"temp_flue_gas": { "name": "Flue gas temperature" },
"mixer_temp1": { "name": "Mixer 1 temperature" },
"mixer_set_temp1": { "name": "Mixer target temperature" },
"mode": { "name": "Boiler mode" },
"fan_power": { "name": "Fan power" },
"temp_co_set": { "name": "Heating target temperature" }
}
}
}

84 changes: 44 additions & 40 deletions custom_components/econet300/translations/en.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,48 @@
{
"config": {
"abort": {
"already_configured": "Device is already configured"
},
"error": {
"cannot_connect": "Failed to connect",
"invalid_auth": "Invalid authentication",
"unknown": "Unexpected error"
},
"step": {
"user": {
"data": {
"host": "Host",
"password": "Password",
"username": "Username"
}
}
"config": {
"step": {
"user": {
"data": {
"host": "Host",
"username": "Username",
"password": "Password"
}
}
},
"entity":{
"sensor": {
"boiler_power": { "name": "Boiler katilo galia" },
"temp_external_sensor": { "name": "Outside temperature" },
"temp_feeder": {"name": "Feeder temperature"},
"fuel_fevel": { "name": "fuel Level" },
"ther_mostat": { "name": "thermostat" },
"lambda_status": { "name": "lambda Status" },
"lambda_set": { "name": "lambda Set" },
"lambda_level": { "name": "lambda Level" },
"signal": { "name": "signaliukas" },
"temp_co": { "name": "tempCOukas" },
"temp_cwu": { "name": "tempCWUiukas" },
"temp_upper_buffer": { "name": "tempUpper Buffer" },
"temp_lower_buffer": { "name": "tempLower Buffer" },
"temp_flue_gas": { "name": "temp Flue Gas" },
"mixer_temp1": { "name": "mixer Temp1" },
"mixer_set_temp1": { "name": "mixer SetT emp1" },
"mode": { "name": "Modukas" },
"fan_power": { "name": "fanPoweriukas" },
"temp_co_set": { "name": "tempCOSetukas" }
}
"error": {
"cannot_connect": "Failed to connect",
"invalid_auth": "Invalid authentication",
"unknown": "Unexpected error"
},
"abort": {
"already_configured": "Device is already configured"
}
},
"entity": {
"binary_sensor": {
"mixer_pump1": { "name": "Mixer 1 pump" },
"boiler_pump": { "name": "Boiler pump" }
},
"sensor": {
"boiler_power": { "name": "Boiler power" },
"temp_external_sensor": { "name": "Outside temperature" },
"temp_feeder": {"name": "Feeder temperature"},
"fuel_level": { "name": "Fuel level" },
"thermostat": { "name": "Thermostat" },
"lambda_status": { "name": "Lambda status" },
"lambda_set": { "name": "Lambda set" },
"lambda_level": { "name": "Lambda level" },
"signal": { "name": "Signal quality" },
"temp_co": { "name": "Heating temperature" },
"temp_cwu": { "name": "Water heater temperature" },
"temp_upper_buffer": { "name": "Upper buffer temperature" },
"temp_lower_buffer": { "name": "Lower buffer temperature" },
"temp_flue_gas": { "name": "Flue gas temperature" },
"mixer_temp1": { "name": "Mixer 1 temperature" },
"mixer_set_temp1": { "name": "Mixer target temperature" },
"mode": { "name": "Boiler mode" },
"fan_power": { "name": "Fan power" },
"temp_co_set": { "name": "Heating target temperature" }
}
}
}
}
63 changes: 45 additions & 18 deletions custom_components/econet300/translations/pl.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,48 @@
{
"config": {
"abort": {
"already_configured": "Urządzenie zostało już skonfigutowane"
},
"error": {
"cannot_connect": "Błąd połączenia",
"invalid_auth": "Błąd autoryzacji",
"unknown": "Niespodziewany błąd"
},
"step": {
"user": {
"data": {
"host": "Host",
"password": "Hasło",
"username": "Nazwa użytkownika"
}
}
"config": {
"step": {
"user": {
"data": {
"host": "Host",
"username": "Hasło",
"password": "Nazwa użytkownika"
}
}
},
"error": {
"cannot_connect": "Błąd połączenia",
"invalid_auth": "Błąd autoryzacji",
"unknown": "Niespodziewany błąd"
},
"abort": {
"already_configured": "Urządzenie zostało już skonfigutowane"
}
}
},
"entity":{
"binary_sensor": {
"mixer_pump1": { "name": "Mixer 1 pump" },
"boiler_pump": { "name": "Boiler pump" }
},
"sensor": {
"boiler_power": { "name": "Boiler katilo galia" },
"temp_external_sensor": { "name": "Outside temperature" },
"temp_feeder": {"name": "Feeder temperature"},
"fuel_level": { "name": "Fuel level" },
"thermostat": { "name": "Thermostat" },
"lambda_status": { "name": "Lambda status" },
"lambda_set": { "name": "Lambda set" },
"lambda_level": { "name": "Lambda level" },
"signal": { "name": "Signal quality" },
"temp_co": { "name": "Heating temperature" },
"temp_cwu": { "name": "Water heater temperature" },
"temp_upper_buffer": { "name": "Upper buffer temperature" },
"temp_lower_buffer": { "name": "Lower buffer temperature" },
"temp_flue_gas": { "name": "Flue gas temperature" },
"mixer_temp1": { "name": "Mixer 1 temperature" },
"mixer_set_temp1": { "name": "Mixer target temperature" },
"mode": { "name": "Boiler mode" },
"fan_power": { "name": "Fan power" },
"temp_co_set": { "name": "Heating target temperature" }
}
}
}

0 comments on commit 0a54d09

Please sign in to comment.