Add icon translations to Skybell (#112225)

This commit is contained in:
Joost Lekkerkerker 2024-03-05 08:46:38 +01:00 committed by GitHub
parent ddcb38289e
commit 79fcedef15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 7 deletions

View File

@ -0,0 +1,27 @@
{
"entity": {
"sensor": {
"chime_level": {
"default": "mdi:bell-ring"
},
"last_button_event": {
"default": "mdi:clock"
},
"last_motion_event": {
"default": "mdi:clock"
},
"last_check_in": {
"default": "mdi:clock"
},
"motion_threshold": {
"default": "mdi:walk"
},
"wifi_ssid": {
"default": "mdi:wifi-settings"
},
"wifi_status": {
"default": "mdi:wifi-strength-3"
}
}
}
}

View File

@ -40,27 +40,23 @@ SENSOR_TYPES: tuple[SkybellSensorEntityDescription, ...] = (
SkybellSensorEntityDescription(
key="chime_level",
translation_key="chime_level",
icon="mdi:bell-ring",
value_fn=lambda device: device.outdoor_chime_level,
),
SkybellSensorEntityDescription(
key="last_button_event",
translation_key="last_button_event",
icon="mdi:clock",
device_class=SensorDeviceClass.TIMESTAMP,
value_fn=lambda device: device.latest("button").get(CONST.CREATED_AT),
),
SkybellSensorEntityDescription(
key="last_motion_event",
translation_key="last_motion_event",
icon="mdi:clock",
device_class=SensorDeviceClass.TIMESTAMP,
value_fn=lambda device: device.latest("motion").get(CONST.CREATED_AT),
),
SkybellSensorEntityDescription(
key=CONST.ATTR_LAST_CHECK_IN,
translation_key="last_check_in",
icon="mdi:clock",
entity_registry_enabled_default=False,
device_class=SensorDeviceClass.TIMESTAMP,
entity_category=EntityCategory.DIAGNOSTIC,
@ -69,7 +65,6 @@ SENSOR_TYPES: tuple[SkybellSensorEntityDescription, ...] = (
SkybellSensorEntityDescription(
key="motion_threshold",
translation_key="motion_threshold",
icon="mdi:walk",
entity_registry_enabled_default=False,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda device: device.motion_threshold,
@ -84,7 +79,6 @@ SENSOR_TYPES: tuple[SkybellSensorEntityDescription, ...] = (
SkybellSensorEntityDescription(
key=CONST.ATTR_WIFI_SSID,
translation_key="wifi_ssid",
icon="mdi:wifi-settings",
entity_registry_enabled_default=False,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda device: device.wifi_ssid,
@ -92,7 +86,6 @@ SENSOR_TYPES: tuple[SkybellSensorEntityDescription, ...] = (
SkybellSensorEntityDescription(
key=CONST.ATTR_WIFI_STATUS,
translation_key="wifi_status",
icon="mdi:wifi-strength-3",
entity_registry_enabled_default=False,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda device: device.wifi_status,