Add icon translations to ViCare (#112346)

* Add icon translations to ViCare

* Add icon translations to ViCare
This commit is contained in:
Joost Lekkerkerker 2024-03-06 12:35:30 +01:00 committed by GitHub
parent 66fae7ff9d
commit dc2d83f131
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 94 additions and 29 deletions

View File

@ -48,14 +48,12 @@ CIRCUIT_SENSORS: tuple[ViCareBinarySensorEntityDescription, ...] = (
ViCareBinarySensorEntityDescription(
key="circulationpump_active",
translation_key="circulation_pump",
icon="mdi:pump",
device_class=BinarySensorDeviceClass.RUNNING,
value_getter=lambda api: api.getCirculationPumpActive(),
),
ViCareBinarySensorEntityDescription(
key="frost_protection_active",
translation_key="frost_protection",
icon="mdi:snowflake",
value_getter=lambda api: api.getFrostProtectionActive(),
),
)
@ -64,7 +62,6 @@ BURNER_SENSORS: tuple[ViCareBinarySensorEntityDescription, ...] = (
ViCareBinarySensorEntityDescription(
key="burner_active",
translation_key="burner",
icon="mdi:gas-burner",
device_class=BinarySensorDeviceClass.RUNNING,
value_getter=lambda api: api.getActive(),
),
@ -83,7 +80,6 @@ GLOBAL_SENSORS: tuple[ViCareBinarySensorEntityDescription, ...] = (
ViCareBinarySensorEntityDescription(
key="solar_pump_active",
translation_key="solar_pump",
icon="mdi:pump",
device_class=BinarySensorDeviceClass.RUNNING,
value_getter=lambda api: api.getSolarPumpActive(),
),
@ -96,14 +92,12 @@ GLOBAL_SENSORS: tuple[ViCareBinarySensorEntityDescription, ...] = (
ViCareBinarySensorEntityDescription(
key="dhw_circulationpump_active",
translation_key="domestic_hot_water_circulation_pump",
icon="mdi:pump",
device_class=BinarySensorDeviceClass.RUNNING,
value_getter=lambda api: api.getDomesticHotWaterCirculationPumpActive(),
),
ViCareBinarySensorEntityDescription(
key="dhw_pump_active",
translation_key="domestic_hot_water_pump",
icon="mdi:pump",
device_class=BinarySensorDeviceClass.RUNNING,
value_getter=lambda api: api.getDomesticHotWaterPumpActive(),
),

View File

@ -39,7 +39,6 @@ BUTTON_DESCRIPTIONS: tuple[ViCareButtonEntityDescription, ...] = (
ViCareButtonEntityDescription(
key="activate_onetimecharge",
translation_key="activate_onetimecharge",
icon="mdi:shower-head",
entity_category=EntityCategory.CONFIG,
value_getter=lambda api: api.getOneTimeCharge(),
value_setter=lambda api: api.activateOneTimeCharge(),

View File

@ -0,0 +1,93 @@
{
"entity": {
"binary_sensor": {
"circulation_pump": {
"default": "mdi:pump"
},
"frost_protection": {
"default": "mdi:snowflake"
},
"burner": {
"default": "mdi:gas-burner"
},
"solar_pump": {
"default": "mdi:pump"
},
"domestic_hot_water_circulation_pump": {
"default": "mdi:pump"
},
"domestic_hot_water_pump": {
"default": "mdi:pump"
}
},
"button": {
"activate_onetimecharge": {
"default": "mdi:shower-head"
}
},
"number": {
"heating_curve_shift": {
"default": "mdi:plus-minus-variant"
},
"heating_curve_slope": {
"default": "mdi:slope-uphill"
}
},
"sensor": {
"volumetric_flow": {
"default": "mdi:gauge"
},
"ess_state_of_charge": {
"default": "mdi:home-battery"
},
"pcc_transfer_power_exchange": {
"default": "mdi:transmission-tower"
},
"pcc_energy_consumption": {
"default": "mdi:transmission-tower-export"
},
"pcc_energy_feed_in": {
"default": "mdi:transmission-tower-import"
},
"photovoltaic_energy_production_today": {
"default": "mdi:solar-power"
},
"burner_starts": {
"default": "mdi:counter"
},
"burner_hours": {
"default": "mdi:counter"
},
"burner_modulation": {
"default": "mdi:percent"
},
"compressor_starts": {
"default": "mdi:counter"
},
"compressor_hours": {
"default": "mdi:counter"
},
"compressor_hours_loadclass1": {
"default": "mdi:counter"
},
"compressor_hours_loadclass2": {
"default": "mdi:counter"
},
"compressor_hours_loadclass3": {
"default": "mdi:counter"
},
"compressor_hours_loadclass4": {
"default": "mdi:counter"
},
"compressor_hours_loadclass5": {
"default": "mdi:counter"
},
"compressor_phase": {
"default": "mdi:information"
}
}
},
"services": {
"set_vicare_mode": "mdi:cog"
}
}

View File

@ -52,7 +52,6 @@ CIRCUIT_ENTITY_DESCRIPTIONS: tuple[ViCareNumberEntityDescription, ...] = (
ViCareNumberEntityDescription(
key="heating curve shift",
translation_key="heating_curve_shift",
icon="mdi:plus-minus-variant",
entity_category=EntityCategory.CONFIG,
device_class=NumberDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
@ -70,7 +69,6 @@ CIRCUIT_ENTITY_DESCRIPTIONS: tuple[ViCareNumberEntityDescription, ...] = (
ViCareNumberEntityDescription(
key="heating curve slope",
translation_key="heating_curve_slope",
icon="mdi:slope-uphill",
entity_category=EntityCategory.CONFIG,
value_getter=lambda api: api.getHeatingCurveSlope(),
value_setter=lambda api, slope: (

View File

@ -590,7 +590,6 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="volumetric_flow",
translation_key="volumetric_flow",
icon="mdi:gauge",
native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR,
value_getter=lambda api: api.getVolumetricFlowReturn() / 1000,
entity_category=EntityCategory.DIAGNOSTIC,
@ -598,7 +597,7 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
),
ViCareSensorEntityDescription(
key="ess_state_of_charge",
icon="mdi:home-battery",
translation_key="ess_state_of_charge",
native_unit_of_measurement=PERCENTAGE,
device_class=SensorDeviceClass.BATTERY,
state_class=SensorStateClass.MEASUREMENT,
@ -623,7 +622,6 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="pcc_transfer_power_exchange",
translation_key="pcc_transfer_power_exchange",
icon="mdi:transmission-tower",
native_unit_of_measurement=UnitOfPower.WATT,
state_class=SensorStateClass.MEASUREMENT,
value_getter=lambda api: api.getPointOfCommonCouplingTransferPowerExchange(),
@ -631,7 +629,6 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="pcc_energy_consumption",
translation_key="pcc_energy_consumption",
icon="mdi:transmission-tower-export",
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
state_class=SensorStateClass.TOTAL_INCREASING,
value_getter=lambda api: api.getPointOfCommonCouplingTransferConsumptionTotal(),
@ -640,7 +637,6 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="pcc_energy_feed_in",
translation_key="pcc_energy_feed_in",
icon="mdi:transmission-tower-import",
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
state_class=SensorStateClass.TOTAL_INCREASING,
value_getter=lambda api: api.getPointOfCommonCouplingTransferFeedInTotal(),
@ -657,7 +653,6 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="photovoltaic_energy_production_today",
translation_key="photovoltaic_energy_production_today",
icon="mdi:solar-power",
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
state_class=SensorStateClass.TOTAL_INCREASING,
value_getter=lambda api: api.getPhotovoltaicProductionCumulatedCurrentDay(),
@ -688,7 +683,6 @@ BURNER_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="burner_starts",
translation_key="burner_starts",
icon="mdi:counter",
value_getter=lambda api: api.getStarts(),
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.TOTAL_INCREASING,
@ -696,7 +690,6 @@ BURNER_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="burner_hours",
translation_key="burner_hours",
icon="mdi:counter",
native_unit_of_measurement=UnitOfTime.HOURS,
value_getter=lambda api: api.getHours(),
entity_category=EntityCategory.DIAGNOSTIC,
@ -705,7 +698,6 @@ BURNER_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="burner_modulation",
translation_key="burner_modulation",
icon="mdi:percent",
native_unit_of_measurement=PERCENTAGE,
value_getter=lambda api: api.getModulation(),
state_class=SensorStateClass.MEASUREMENT,
@ -716,7 +708,6 @@ COMPRESSOR_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="compressor_starts",
translation_key="compressor_starts",
icon="mdi:counter",
value_getter=lambda api: api.getStarts(),
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.TOTAL_INCREASING,
@ -724,7 +715,6 @@ COMPRESSOR_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="compressor_hours",
translation_key="compressor_hours",
icon="mdi:counter",
native_unit_of_measurement=UnitOfTime.HOURS,
value_getter=lambda api: api.getHours(),
entity_category=EntityCategory.DIAGNOSTIC,
@ -733,7 +723,6 @@ COMPRESSOR_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="compressor_hours_loadclass1",
translation_key="compressor_hours_loadclass1",
icon="mdi:counter",
native_unit_of_measurement=UnitOfTime.HOURS,
value_getter=lambda api: api.getHoursLoadClass1(),
entity_category=EntityCategory.DIAGNOSTIC,
@ -743,7 +732,6 @@ COMPRESSOR_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="compressor_hours_loadclass2",
translation_key="compressor_hours_loadclass2",
icon="mdi:counter",
native_unit_of_measurement=UnitOfTime.HOURS,
value_getter=lambda api: api.getHoursLoadClass2(),
entity_category=EntityCategory.DIAGNOSTIC,
@ -753,7 +741,6 @@ COMPRESSOR_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="compressor_hours_loadclass3",
translation_key="compressor_hours_loadclass3",
icon="mdi:counter",
native_unit_of_measurement=UnitOfTime.HOURS,
value_getter=lambda api: api.getHoursLoadClass3(),
entity_category=EntityCategory.DIAGNOSTIC,
@ -763,7 +750,6 @@ COMPRESSOR_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="compressor_hours_loadclass4",
translation_key="compressor_hours_loadclass4",
icon="mdi:counter",
native_unit_of_measurement=UnitOfTime.HOURS,
value_getter=lambda api: api.getHoursLoadClass4(),
entity_category=EntityCategory.DIAGNOSTIC,
@ -773,7 +759,6 @@ COMPRESSOR_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="compressor_hours_loadclass5",
translation_key="compressor_hours_loadclass5",
icon="mdi:counter",
native_unit_of_measurement=UnitOfTime.HOURS,
value_getter=lambda api: api.getHoursLoadClass5(),
entity_category=EntityCategory.DIAGNOSTIC,
@ -783,7 +768,6 @@ COMPRESSOR_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
ViCareSensorEntityDescription(
key="compressor_phase",
translation_key="compressor_phase",
icon="mdi:information",
value_getter=lambda api: api.getPhase(),
entity_category=EntityCategory.DIAGNOSTIC,
),

View File

@ -4,7 +4,6 @@
'attributes': ReadOnlyDict({
'device_class': 'running',
'friendly_name': 'model0 Burner',
'icon': 'mdi:gas-burner',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model0_burner',
@ -18,7 +17,6 @@
'attributes': ReadOnlyDict({
'device_class': 'running',
'friendly_name': 'model0 Circulation pump',
'icon': 'mdi:pump',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model0_circulation_pump',
@ -31,7 +29,6 @@
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'model0 Frost protection',
'icon': 'mdi:snowflake',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model0_frost_protection',