mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 07:47:08 +00:00
Use device class translations for Fritzbox (#95363)
This commit is contained in:
parent
e9eb366f3b
commit
c1e8eb7c96
@ -91,7 +91,6 @@ def value_scheduled_preset(device: FritzhomeDevice) -> str:
|
|||||||
SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = (
|
SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = (
|
||||||
FritzSensorEntityDescription(
|
FritzSensorEntityDescription(
|
||||||
key="temperature",
|
key="temperature",
|
||||||
translation_key="temperature",
|
|
||||||
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||||
device_class=SensorDeviceClass.TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
@ -101,7 +100,6 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = (
|
|||||||
),
|
),
|
||||||
FritzSensorEntityDescription(
|
FritzSensorEntityDescription(
|
||||||
key="humidity",
|
key="humidity",
|
||||||
translation_key="humidity",
|
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
device_class=SensorDeviceClass.HUMIDITY,
|
device_class=SensorDeviceClass.HUMIDITY,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
@ -110,7 +108,6 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = (
|
|||||||
),
|
),
|
||||||
FritzSensorEntityDescription(
|
FritzSensorEntityDescription(
|
||||||
key="battery",
|
key="battery",
|
||||||
translation_key="battery",
|
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
device_class=SensorDeviceClass.BATTERY,
|
device_class=SensorDeviceClass.BATTERY,
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
@ -119,7 +116,6 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = (
|
|||||||
),
|
),
|
||||||
FritzSensorEntityDescription(
|
FritzSensorEntityDescription(
|
||||||
key="power_consumption",
|
key="power_consumption",
|
||||||
translation_key="power_consumption",
|
|
||||||
native_unit_of_measurement=UnitOfPower.WATT,
|
native_unit_of_measurement=UnitOfPower.WATT,
|
||||||
device_class=SensorDeviceClass.POWER,
|
device_class=SensorDeviceClass.POWER,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
@ -128,7 +124,6 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = (
|
|||||||
),
|
),
|
||||||
FritzSensorEntityDescription(
|
FritzSensorEntityDescription(
|
||||||
key="voltage",
|
key="voltage",
|
||||||
translation_key="voltage",
|
|
||||||
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
||||||
device_class=SensorDeviceClass.VOLTAGE,
|
device_class=SensorDeviceClass.VOLTAGE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
@ -137,7 +132,6 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = (
|
|||||||
),
|
),
|
||||||
FritzSensorEntityDescription(
|
FritzSensorEntityDescription(
|
||||||
key="electric_current",
|
key="electric_current",
|
||||||
translation_key="electric_current",
|
|
||||||
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
||||||
device_class=SensorDeviceClass.CURRENT,
|
device_class=SensorDeviceClass.CURRENT,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
@ -146,7 +140,6 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = (
|
|||||||
),
|
),
|
||||||
FritzSensorEntityDescription(
|
FritzSensorEntityDescription(
|
||||||
key="total_energy",
|
key="total_energy",
|
||||||
translation_key="total_energy",
|
|
||||||
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
@ -44,33 +44,12 @@
|
|||||||
"lock": { "name": "Button lock on device" }
|
"lock": { "name": "Button lock on device" }
|
||||||
},
|
},
|
||||||
"sensor": {
|
"sensor": {
|
||||||
"battery": {
|
|
||||||
"name": "[%key:component::sensor::entity_component::battery::name%]"
|
|
||||||
},
|
|
||||||
"comfort_temperature": { "name": "Comfort temperature" },
|
"comfort_temperature": { "name": "Comfort temperature" },
|
||||||
"eco_temperature": { "name": "Eco temperature" },
|
"eco_temperature": { "name": "Eco temperature" },
|
||||||
"electric_current": {
|
|
||||||
"name": "[%key:component::sensor::entity_component::current::name%]"
|
|
||||||
},
|
|
||||||
"humidity": {
|
|
||||||
"name": "[%key:component::sensor::entity_component::humidity::name%]"
|
|
||||||
},
|
|
||||||
"nextchange_preset": { "name": "Next scheduled preset" },
|
"nextchange_preset": { "name": "Next scheduled preset" },
|
||||||
"nextchange_temperature": { "name": "Next scheduled temperature" },
|
"nextchange_temperature": { "name": "Next scheduled temperature" },
|
||||||
"nextchange_time": { "name": "Next scheduled change time" },
|
"nextchange_time": { "name": "Next scheduled change time" },
|
||||||
"power_consumption": {
|
"scheduled_preset": { "name": "Current scheduled preset" }
|
||||||
"name": "[%key:component::sensor::entity_component::power::name%]"
|
|
||||||
},
|
|
||||||
"scheduled_preset": { "name": "Current scheduled preset" },
|
|
||||||
"temperature": {
|
|
||||||
"name": "[%key:component::sensor::entity_component::temperature::name%]"
|
|
||||||
},
|
|
||||||
"total_energy": {
|
|
||||||
"name": "[%key:component::sensor::entity_component::energy::name%]"
|
|
||||||
},
|
|
||||||
"voltage": {
|
|
||||||
"name": "[%key:component::sensor::entity_component::voltage::name%]"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user