Skip to content

Commit

Permalink
obey naming conventions of hassfest
Browse files Browse the repository at this point in the history
  • Loading branch information
geeks-r-us committed Mar 17, 2024
1 parent c501094 commit 2582011
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 deletions custom_components/maxstorage_ultimate/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def _handle_coordinator_update(self) -> None:
SENSOR_TYPES: tuple[MaxStorageSensorDescription, ...] = (
MaxStorageSensorDescription(
key="batterySoC",
translation_key="batterySoC",
translation_key="battery_soc",
icon="mdi:battery",
value_fn=lambda data: data["batterySoC"],
native_unit_of_measurement=PERCENTAGE,
Expand All @@ -102,7 +102,7 @@ def _handle_coordinator_update(self) -> None:
),
MaxStorageSensorDescription(
key="batteryCapacity",
translation_key="batteryCapacity",
translation_key="battery_capacity",
icon="mdi:battery",
value_fn=lambda data: data["batteryCapacity"],
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
Expand All @@ -111,7 +111,7 @@ def _handle_coordinator_update(self) -> None:
),
MaxStorageSensorDescription(
key="batteryPower",
translation_key="batteryPower",
translation_key="battery_power",
icon="mdi:battery",
value_fn=lambda data: data["batteryPower"],
native_unit_of_measurement=UnitOfPower.WATT,
Expand All @@ -120,7 +120,7 @@ def _handle_coordinator_update(self) -> None:
),
MaxStorageSensorDescription(
key="gridPower",
translation_key="gridPower",
translation_key="grid_power",
icon="mdi:transmission-tower",
value_fn=lambda data: data["gridPower"],
native_unit_of_measurement=UnitOfPower.WATT,
Expand All @@ -129,7 +129,7 @@ def _handle_coordinator_update(self) -> None:
),
MaxStorageSensorDescription(
key="usagePower",
translation_key="usagePower",
translation_key="usage_power",
icon="mdi:transmission-tower",
value_fn=lambda data: data["usagePower"],
native_unit_of_measurement=UnitOfPower.WATT,
Expand All @@ -138,15 +138,15 @@ def _handle_coordinator_update(self) -> None:
),
MaxStorageSensorDescription(
key="plantPower",
translation_key="plantPower",
translation_key="plant_power",
icon="mdi:solar-power",
value_fn=lambda data: data["plantPower"],
native_unit_of_measurement=UnitOfPower.WATT,
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.POWER,
),
MaxStorageSensorDescription(
key="storageDCPower",
key="storage_dc_power",
translation_key="storageDCPower",
icon="mdi:solar-power",
value_fn=lambda data: data["storageDCPower"],
Expand Down
14 changes: 7 additions & 7 deletions custom_components/maxstorage_ultimate/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@
},
"entity": {
"sensor": {
"batterySoC": {
"battery_soc": {
"name": "Batterie SoC"
},
"batteryCapacity": {
"battery_capacity": {
"name": "Batterie Kapazität"
},
"batteryPower": {
"battery_power": {
"name": "Batterie Leistung"
},
"gridPower": {
"grid_power": {
"name": "Netzleistung"
},
"usagePower": {
"usage_power": {
"name": "Energieverbrauch"
},
"plantPower": {
"plant_power": {
"name": "PV-Leistung"
},
"storageDCPower": {
"storage_dc_power": {
"name": "Speicher DC Leistung"
}
}
Expand Down
14 changes: 7 additions & 7 deletions custom_components/maxstorage_ultimate/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@
},
"entity": {
"sensor": {
"batterySoC": {
"battery_soc": {
"name": "Battery SoC"
},
"batteryCapacity": {
"battery_capacity": {
"name": "Battery Capacity"
},
"batteryPower": {
"battery_power": {
"name": "Battery Power"
},
"gridPower": {
"grid_power": {
"name": "Grid Power"
},
"usagePower": {
"usage_power": {
"name": "Usage Power"
},
"plantPower": {
"plant_power": {
"name": "Plant Power"
},
"storageDCPower": {
"storage_dc_power": {
"name": "Storage DC Power"
}
}
Expand Down

0 comments on commit 2582011

Please sign in to comment.