Add icon translations to YouTube (#112365)

* Add icon translations to YouTube

* Add icon translations to YouTube
This commit is contained in:
Joost Lekkerkerker 2024-03-05 13:59:08 +01:00 committed by GitHub
parent a26e52aa0c
commit afdb7d15ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 6 deletions

View File

@ -0,0 +1,12 @@
{
"entity": {
"sensor": {
"latest_upload": {
"default": "mdi:youtube"
},
"subscribers": {
"default": "mdi:youtube-subscription"
}
}
}
}

View File

@ -45,7 +45,6 @@ SENSOR_TYPES = [
YouTubeSensorEntityDescription(
key="latest_upload",
translation_key="latest_upload",
icon="mdi:youtube",
available_fn=lambda channel: channel[ATTR_LATEST_VIDEO] is not None,
value_fn=lambda channel: channel[ATTR_LATEST_VIDEO][ATTR_TITLE],
entity_picture_fn=lambda channel: channel[ATTR_LATEST_VIDEO][ATTR_THUMBNAIL],
@ -57,7 +56,6 @@ SENSOR_TYPES = [
YouTubeSensorEntityDescription(
key="subscribers",
translation_key="subscribers",
icon="mdi:youtube-subscription",
native_unit_of_measurement="subscribers",
available_fn=lambda _: True,
value_fn=lambda channel: channel[ATTR_SUBSCRIBER_COUNT],

View File

@ -4,7 +4,6 @@
'attributes': ReadOnlyDict({
'entity_picture': 'https://i.ytimg.com/vi/wysukDrMdqU/maxresdefault.jpg',
'friendly_name': 'Google for Developers Latest upload',
'icon': 'mdi:youtube',
'published_at': datetime.datetime(2023, 5, 11, 0, 20, 46, tzinfo=datetime.timezone.utc),
'video_id': 'wysukDrMdqU',
}),
@ -20,7 +19,6 @@
'attributes': ReadOnlyDict({
'entity_picture': 'https://yt3.ggpht.com/fca_HuJ99xUxflWdex0XViC3NfctBFreIl8y4i9z411asnGTWY-Ql3MeH_ybA4kNaOjY7kyA=s800-c-k-c0x00ffffff-no-rj',
'friendly_name': 'Google for Developers Subscribers',
'icon': 'mdi:youtube-subscription',
'unit_of_measurement': 'subscribers',
}),
'context': <ANY>,
@ -34,7 +32,6 @@
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Google for Developers Latest upload',
'icon': 'mdi:youtube',
}),
'context': <ANY>,
'entity_id': 'sensor.google_for_developers_latest_upload',
@ -48,7 +45,6 @@
'attributes': ReadOnlyDict({
'entity_picture': 'https://yt3.ggpht.com/fca_HuJ99xUxflWdex0XViC3NfctBFreIl8y4i9z411asnGTWY-Ql3MeH_ybA4kNaOjY7kyA=s800-c-k-c0x00ffffff-no-rj',
'friendly_name': 'Google for Developers Subscribers',
'icon': 'mdi:youtube-subscription',
'unit_of_measurement': 'subscribers',
}),
'context': <ANY>,