Use device class naming for sfr box (#96092)

This commit is contained in:
Joost Lekkerkerker 2023-07-11 20:19:04 +02:00 committed by GitHub
parent e9f76ed3d3
commit fe6402ef73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 3 additions and 17 deletions

View File

@ -67,7 +67,6 @@ BUTTON_TYPES: tuple[SFRBoxButtonEntityDescription, ...] = (
device_class=ButtonDeviceClass.RESTART, device_class=ButtonDeviceClass.RESTART,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
key="system_reboot", key="system_reboot",
translation_key="reboot",
), ),
) )

View File

@ -180,7 +180,6 @@ SYSTEM_SENSOR_TYPES: tuple[SFRBoxSensorEntityDescription[SystemInfo], ...] = (
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT,
translation_key="voltage",
value_fn=lambda x: x.alimvoltage, value_fn=lambda x: x.alimvoltage,
), ),
SFRBoxSensorEntityDescription[SystemInfo]( SFRBoxSensorEntityDescription[SystemInfo](
@ -189,7 +188,6 @@ SYSTEM_SENSOR_TYPES: tuple[SFRBoxSensorEntityDescription[SystemInfo], ...] = (
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
native_unit_of_measurement=UnitOfTemperature.CELSIUS, native_unit_of_measurement=UnitOfTemperature.CELSIUS,
translation_key="temperature",
value_fn=lambda x: x.temperature / 1000, value_fn=lambda x: x.temperature / 1000,
), ),
) )

View File

@ -42,11 +42,6 @@
"name": "WAN status" "name": "WAN status"
} }
}, },
"button": {
"reboot": {
"name": "[%key:component::button::entity_component::restart::name%]"
}
},
"sensor": { "sensor": {
"dsl_attenuation_down": { "dsl_attenuation_down": {
"name": "DSL attenuation down" "name": "DSL attenuation down"
@ -110,12 +105,6 @@
"unknown": "Unknown" "unknown": "Unknown"
} }
}, },
"temperature": {
"name": "[%key:component::sensor::entity_component::temperature::name%]"
},
"voltage": {
"name": "[%key:component::sensor::entity_component::voltage::name%]"
},
"wan_mode": { "wan_mode": {
"name": "WAN mode", "name": "WAN mode",
"state": { "state": {

View File

@ -54,7 +54,7 @@
'original_name': 'Restart', 'original_name': 'Restart',
'platform': 'sfr_box', 'platform': 'sfr_box',
'supported_features': 0, 'supported_features': 0,
'translation_key': 'reboot', 'translation_key': None,
'unique_id': 'e4:5d:51:00:11:22_system_reboot', 'unique_id': 'e4:5d:51:00:11:22_system_reboot',
'unit_of_measurement': None, 'unit_of_measurement': None,
}), }),

View File

@ -89,7 +89,7 @@
'original_name': 'Voltage', 'original_name': 'Voltage',
'platform': 'sfr_box', 'platform': 'sfr_box',
'supported_features': 0, 'supported_features': 0,
'translation_key': 'voltage', 'translation_key': None,
'unique_id': 'e4:5d:51:00:11:22_system_alimvoltage', 'unique_id': 'e4:5d:51:00:11:22_system_alimvoltage',
'unit_of_measurement': <UnitOfElectricPotential.MILLIVOLT: 'mV'>, 'unit_of_measurement': <UnitOfElectricPotential.MILLIVOLT: 'mV'>,
}), }),
@ -117,7 +117,7 @@
'original_name': 'Temperature', 'original_name': 'Temperature',
'platform': 'sfr_box', 'platform': 'sfr_box',
'supported_features': 0, 'supported_features': 0,
'translation_key': 'temperature', 'translation_key': None,
'unique_id': 'e4:5d:51:00:11:22_system_temperature', 'unique_id': 'e4:5d:51:00:11:22_system_temperature',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>, 'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}), }),