Add entity translations to SolarEdge (#102295)

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Joost Lekkerkerker 2023-10-22 21:02:39 +02:00 committed by GitHub
parent b416c8fbf6
commit 6b618fc95a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 88 additions and 21 deletions

View File

@ -51,7 +51,7 @@ SENSOR_TYPES = [
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="lifetime_energy", key="lifetime_energy",
json_key="lifeTimeData", json_key="lifeTimeData",
name="Lifetime energy", translation_key="lifetime_energy",
icon="mdi:solar-power", icon="mdi:solar-power",
state_class=SensorStateClass.TOTAL, state_class=SensorStateClass.TOTAL,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
@ -60,7 +60,7 @@ SENSOR_TYPES = [
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="energy_this_year", key="energy_this_year",
json_key="lastYearData", json_key="lastYearData",
name="Energy this year", translation_key="energy_this_year",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
icon="mdi:solar-power", icon="mdi:solar-power",
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
@ -69,7 +69,7 @@ SENSOR_TYPES = [
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="energy_this_month", key="energy_this_month",
json_key="lastMonthData", json_key="lastMonthData",
name="Energy this month", translation_key="energy_this_month",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
icon="mdi:solar-power", icon="mdi:solar-power",
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
@ -78,7 +78,7 @@ SENSOR_TYPES = [
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="energy_today", key="energy_today",
json_key="lastDayData", json_key="lastDayData",
name="Energy today", translation_key="energy_today",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
icon="mdi:solar-power", icon="mdi:solar-power",
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
@ -87,7 +87,7 @@ SENSOR_TYPES = [
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="current_power", key="current_power",
json_key="currentPower", json_key="currentPower",
name="Current Power", translation_key="current_power",
icon="mdi:solar-power", icon="mdi:solar-power",
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfPower.WATT, native_unit_of_measurement=UnitOfPower.WATT,
@ -96,71 +96,71 @@ SENSOR_TYPES = [
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="site_details", key="site_details",
json_key="status", json_key="status",
name="Site details", translation_key="site_details",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
), ),
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="meters", key="meters",
json_key="meters", json_key="meters",
name="Meters", translation_key="meters",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
), ),
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="sensors", key="sensors",
json_key="sensors", json_key="sensors",
name="Sensors", translation_key="sensors",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
), ),
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="gateways", key="gateways",
json_key="gateways", json_key="gateways",
name="Gateways", translation_key="gateways",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
), ),
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="batteries", key="batteries",
json_key="batteries", json_key="batteries",
name="Batteries", translation_key="batteries",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
), ),
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="inverters", key="inverters",
json_key="inverters", json_key="inverters",
name="Inverters", translation_key="inverters",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
), ),
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="power_consumption", key="power_consumption",
json_key="LOAD", json_key="LOAD",
name="Power Consumption", translation_key="power_consumption",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
icon="mdi:flash", icon="mdi:flash",
), ),
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="solar_power", key="solar_power",
json_key="PV", json_key="PV",
name="Solar Power", translation_key="solar_power",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
icon="mdi:solar-power", icon="mdi:solar-power",
), ),
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="grid_power", key="grid_power",
json_key="GRID", json_key="GRID",
name="Grid Power", translation_key="grid_power",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
icon="mdi:power-plug", icon="mdi:power-plug",
), ),
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="storage_power", key="storage_power",
json_key="STORAGE", json_key="STORAGE",
name="Storage Power", translation_key="storage_power",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
icon="mdi:car-battery", icon="mdi:car-battery",
), ),
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="purchased_energy", key="purchased_energy",
json_key="Purchased", json_key="Purchased",
name="Imported Energy", translation_key="purchased_energy",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
state_class=SensorStateClass.TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
@ -169,7 +169,7 @@ SENSOR_TYPES = [
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="production_energy", key="production_energy",
json_key="Production", json_key="Production",
name="Production Energy", translation_key="production_energy",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
state_class=SensorStateClass.TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
@ -178,7 +178,7 @@ SENSOR_TYPES = [
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="consumption_energy", key="consumption_energy",
json_key="Consumption", json_key="Consumption",
name="Consumption Energy", translation_key="consumption_energy",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
state_class=SensorStateClass.TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
@ -187,7 +187,7 @@ SENSOR_TYPES = [
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="selfconsumption_energy", key="selfconsumption_energy",
json_key="SelfConsumption", json_key="SelfConsumption",
name="SelfConsumption Energy", translation_key="selfconsumption_energy",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
state_class=SensorStateClass.TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
@ -196,7 +196,7 @@ SENSOR_TYPES = [
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="feedin_energy", key="feedin_energy",
json_key="FeedIn", json_key="FeedIn",
name="Exported Energy", translation_key="feedin_energy",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
state_class=SensorStateClass.TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
@ -205,7 +205,7 @@ SENSOR_TYPES = [
SolarEdgeSensorEntityDescription( SolarEdgeSensorEntityDescription(
key="storage_level", key="storage_level",
json_key="STORAGE", json_key="STORAGE",
name="Storage Level", translation_key="storage_level",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,

View File

@ -19,5 +19,72 @@
"abort": { "abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]" "already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
} }
},
"entity": {
"sensor": {
"lifetime_energy": {
"name": "Lifetime energy"
},
"energy_this_year": {
"name": "Energy this year"
},
"energy_this_month": {
"name": "Energy this month"
},
"energy_today": {
"name": "Energy today"
},
"current_power": {
"name": "Current power"
},
"site_details": {
"name": "Site details"
},
"meters": {
"name": "Meters"
},
"sensors": {
"name": "Sensors"
},
"gateways": {
"name": "Gateways"
},
"batteries": {
"name": "Batteries"
},
"inverters": {
"name": "Inverters"
},
"power_consumption": {
"name": "Power consumption"
},
"solar_power": {
"name": "Solar power"
},
"grid_power": {
"name": "Grid power"
},
"storage_power": {
"name": "Stored power"
},
"purchased_energy": {
"name": "Imported energy"
},
"production_energy": {
"name": "Produced energy"
},
"consumption_energy": {
"name": "Consumed energy"
},
"selfconsumption_energy": {
"name": "Self-consumed energy"
},
"feedin_energy": {
"name": "Exported energy"
},
"storage_level": {
"name": "Storage level"
}
}
} }
} }