Add icon translations to Kaleidescape (#111850)

This commit is contained in:
Joost Lekkerkerker 2024-02-29 17:20:12 +01:00 committed by GitHub
parent 0d85e316a2
commit 87632dcb6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 54 additions and 16 deletions

View File

@ -0,0 +1,54 @@
{
"entity": {
"sensor": {
"media_location": {
"default": "mdi:monitor"
},
"play_status": {
"default": "mdi:monitor"
},
"play_speed": {
"default": "mdi:monitor"
},
"video_mode": {
"default": "mdi:monitor-screenshot"
},
"video_color_eotf": {
"default": "mdi:monitor-eye"
},
"video_color_space": {
"default": "mdi:monitor-eye"
},
"video_color_depth": {
"default": "mdi:monitor-eye"
},
"video_color_sampling": {
"default": "mdi:monitor-eye"
},
"screen_mask_ratio": {
"default": "mdi:monitor-screenshot"
},
"screen_mask_top_trim_rel": {
"default": "mdi:monitor-screenshot"
},
"screen_mask_bottom_trim_rel": {
"default": "mdi:monitor-screenshot"
},
"screen_mask_conservative_ratio": {
"default": "mdi:monitor-screenshot"
},
"screen_mask_top_mask_abs": {
"default": "mdi:monitor-screenshot"
},
"screen_mask_bottom_mask_abs": {
"default": "mdi:monitor-screenshot"
},
"cinemascape_mask": {
"default": "mdi:monitor-star"
},
"cinemascape_mode": {
"default": "mdi:monitor-star"
}
}
}
}

View File

@ -40,67 +40,57 @@ SENSOR_TYPES: tuple[KaleidescapeSensorEntityDescription, ...] = (
KaleidescapeSensorEntityDescription(
key="media_location",
translation_key="media_location",
icon="mdi:monitor",
value_fn=lambda device: device.automation.movie_location,
),
KaleidescapeSensorEntityDescription(
key="play_status",
translation_key="play_status",
icon="mdi:monitor",
value_fn=lambda device: device.movie.play_status,
),
KaleidescapeSensorEntityDescription(
key="play_speed",
translation_key="play_speed",
icon="mdi:monitor",
value_fn=lambda device: device.movie.play_speed,
),
KaleidescapeSensorEntityDescription(
key="video_mode",
translation_key="video_mode",
icon="mdi:monitor-screenshot",
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda device: device.automation.video_mode,
),
KaleidescapeSensorEntityDescription(
key="video_color_eotf",
translation_key="video_color_eotf",
icon="mdi:monitor-eye",
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda device: device.automation.video_color_eotf,
),
KaleidescapeSensorEntityDescription(
key="video_color_space",
translation_key="video_color_space",
icon="mdi:monitor-eye",
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda device: device.automation.video_color_space,
),
KaleidescapeSensorEntityDescription(
key="video_color_depth",
translation_key="video_color_depth",
icon="mdi:monitor-eye",
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda device: device.automation.video_color_depth,
),
KaleidescapeSensorEntityDescription(
key="video_color_sampling",
translation_key="video_color_sampling",
icon="mdi:monitor-eye",
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda device: device.automation.video_color_sampling,
),
KaleidescapeSensorEntityDescription(
key="screen_mask_ratio",
translation_key="screen_mask_ratio",
icon="mdi:monitor-screenshot",
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda device: device.automation.screen_mask_ratio,
),
KaleidescapeSensorEntityDescription(
key="screen_mask_top_trim_rel",
translation_key="screen_mask_top_trim_rel",
icon="mdi:monitor-screenshot",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=PERCENTAGE,
value_fn=lambda device: device.automation.screen_mask_top_trim_rel / 10.0,
@ -108,7 +98,6 @@ SENSOR_TYPES: tuple[KaleidescapeSensorEntityDescription, ...] = (
KaleidescapeSensorEntityDescription(
key="screen_mask_bottom_trim_rel",
translation_key="screen_mask_bottom_trim_rel",
icon="mdi:monitor-screenshot",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=PERCENTAGE,
value_fn=lambda device: device.automation.screen_mask_bottom_trim_rel / 10.0,
@ -116,14 +105,12 @@ SENSOR_TYPES: tuple[KaleidescapeSensorEntityDescription, ...] = (
KaleidescapeSensorEntityDescription(
key="screen_mask_conservative_ratio",
translation_key="screen_mask_conservative_ratio",
icon="mdi:monitor-screenshot",
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda device: device.automation.screen_mask_conservative_ratio,
),
KaleidescapeSensorEntityDescription(
key="screen_mask_top_mask_abs",
translation_key="screen_mask_top_mask_abs",
icon="mdi:monitor-screenshot",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=PERCENTAGE,
value_fn=lambda device: device.automation.screen_mask_top_mask_abs / 10.0,
@ -131,7 +118,6 @@ SENSOR_TYPES: tuple[KaleidescapeSensorEntityDescription, ...] = (
KaleidescapeSensorEntityDescription(
key="screen_mask_bottom_mask_abs",
translation_key="screen_mask_bottom_mask_abs",
icon="mdi:monitor-screenshot",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=PERCENTAGE,
value_fn=lambda device: device.automation.screen_mask_bottom_mask_abs / 10.0,
@ -139,14 +125,12 @@ SENSOR_TYPES: tuple[KaleidescapeSensorEntityDescription, ...] = (
KaleidescapeSensorEntityDescription(
key="cinemascape_mask",
translation_key="cinemascape_mask",
icon="mdi:monitor-star",
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda device: device.automation.cinemascape_mask,
),
KaleidescapeSensorEntityDescription(
key="cinemascape_mode",
translation_key="cinemascape_mode",
icon="mdi:monitor-star",
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda device: device.automation.cinemascape_mode,
),