diff --git a/.github/workflows/hassfest.yml b/.github/workflows/hassfest.yml new file mode 100644 index 0000000..07d1dda --- /dev/null +++ b/.github/workflows/hassfest.yml @@ -0,0 +1,14 @@ +name: Validate with hassfest + +on: + push: + pull_request: + schedule: + - cron: "0 0 * * *" + +jobs: + validate: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v3" + - uses: home-assistant/actions/hassfest@master diff --git a/custom_components/maxstorage_ultimate/.github/workflows/validate.yml b/.github/workflows/validate.yml similarity index 100% rename from custom_components/maxstorage_ultimate/.github/workflows/validate.yml rename to .github/workflows/validate.yml diff --git a/custom_components/maxstorage_ultimate/manifest.json b/custom_components/maxstorage_ultimate/manifest.json index c46c110..e7cbb8c 100644 --- a/custom_components/maxstorage_ultimate/manifest.json +++ b/custom_components/maxstorage_ultimate/manifest.json @@ -2,9 +2,12 @@ "domain": "maxstorage_ultimate", "name": "Max.Storage Ultimate", "codeowners": ["@geeks-r-us"], - "requirements": ["aiohttp", "zeroconf", "beautifulsoup4"], - "zeroconf": ["_maxstorage._tcp.local."], "config_flow": true, + "documentation": "https://github.com/geeks-r-us/maxstorage_ultimate", "integration_type": "hub", - "version": "0.0.1" + "iot_class": "local_polling", + "issue_tracker": "https://github.com/geeks-r-us/maxstorage_ultimate/issues", + "requirements": ["aiohttp", "zeroconf", "beautifulsoup4"], + "version": "0.0.1", + "zeroconf": ["_maxstorage._tcp.local."] } \ No newline at end of file diff --git a/custom_components/maxstorage_ultimate/sensor.py b/custom_components/maxstorage_ultimate/sensor.py index 046bcc0..dfac63c 100644 --- a/custom_components/maxstorage_ultimate/sensor.py +++ b/custom_components/maxstorage_ultimate/sensor.py @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -138,7 +138,7 @@ 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, @@ -146,7 +146,7 @@ def _handle_coordinator_update(self) -> None: device_class=SensorDeviceClass.POWER, ), MaxStorageSensorDescription( - key="storageDCPower", + key="storage_dc_power", translation_key="storageDCPower", icon="mdi:solar-power", value_fn=lambda data: data["storageDCPower"], diff --git a/custom_components/maxstorage_ultimate/translations/de.json b/custom_components/maxstorage_ultimate/translations/de.json index b9d8cf2..e28ab45 100644 --- a/custom_components/maxstorage_ultimate/translations/de.json +++ b/custom_components/maxstorage_ultimate/translations/de.json @@ -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" } } diff --git a/custom_components/maxstorage_ultimate/translations/en.json b/custom_components/maxstorage_ultimate/translations/en.json index 84a17f0..f9aa6bd 100644 --- a/custom_components/maxstorage_ultimate/translations/en.json +++ b/custom_components/maxstorage_ultimate/translations/en.json @@ -32,25 +32,25 @@ }, "entity": { "sensor": { - "batterySoC": { - "name": "Battery ScC" + "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" } } diff --git a/custom_components/maxstorage_ultimate/hacs.json b/hacs.json similarity index 67% rename from custom_components/maxstorage_ultimate/hacs.json rename to hacs.json index e0312ab..6526e90 100644 --- a/custom_components/maxstorage_ultimate/hacs.json +++ b/hacs.json @@ -1,5 +1,5 @@ { "name": "Max.Storage Ultimate", - "render_readme": "true", + "render_readme": true, "country": "DE" } \ No newline at end of file