Add icons to One-Time Password (OTP) (#120066)

This commit is contained in:
Mr. Bubbles 2024-06-21 11:07:45 +02:00 committed by GitHub
parent d2a5683fa0
commit 818750dfd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 2 deletions

View File

@ -0,0 +1,9 @@
{
"entity": {
"sensor": {
"token": {
"default": "mdi:lock-clock"
}
}
}
}

View File

@ -69,7 +69,7 @@ async def async_setup_entry(
class TOTPSensor(SensorEntity): class TOTPSensor(SensorEntity):
"""Representation of a TOTP sensor.""" """Representation of a TOTP sensor."""
_attr_icon = "mdi:update" _attr_translation_key = "token"
_attr_should_poll = False _attr_should_poll = False
_attr_native_value: StateType = None _attr_native_value: StateType = None
_next_expiration: float | None = None _next_expiration: float | None = None

View File

@ -3,7 +3,6 @@
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'friendly_name': 'OTP Sensor', 'friendly_name': 'OTP Sensor',
'icon': 'mdi:update',
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'sensor.otp_sensor', 'entity_id': 'sensor.otp_sensor',