Add icon translations to Tessie (#111096)

pull/111102/head
Paul Bottein 2024-02-21 19:49:04 +01:00 committed by GitHub
parent ef02fca6ba
commit 0eef449526
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 215 additions and 51 deletions

View File

@ -92,7 +92,7 @@ DESCRIPTIONS: tuple[TessieBinarySensorEntityDescription, ...] = (
),
TessieBinarySensorEntityDescription(
key="vehicle_state_is_user_present",
device_class=BinarySensorDeviceClass.PRESENCE,
device_class=BinarySensorDeviceClass.OCCUPANCY,
),
TessieBinarySensorEntityDescription(
key="vehicle_state_tpms_soft_warning_fl",

View File

@ -31,22 +31,17 @@ class TessieButtonEntityDescription(ButtonEntityDescription):
DESCRIPTIONS: tuple[TessieButtonEntityDescription, ...] = (
TessieButtonEntityDescription(key="wake", func=lambda: wake, icon="mdi:sleep-off"),
TessieButtonEntityDescription(key="wake", func=lambda: wake),
TessieButtonEntityDescription(key="flash_lights", func=lambda: flash_lights),
TessieButtonEntityDescription(key="honk", func=lambda: honk),
TessieButtonEntityDescription(
key="flash_lights", func=lambda: flash_lights, icon="mdi:flashlight"
),
TessieButtonEntityDescription(key="honk", func=lambda: honk, icon="mdi:bullhorn"),
TessieButtonEntityDescription(
key="trigger_homelink", func=lambda: trigger_homelink, icon="mdi:garage"
key="trigger_homelink", func=lambda: trigger_homelink
),
TessieButtonEntityDescription(
key="enable_keyless_driving",
func=lambda: enable_keyless_driving,
icon="mdi:car-key",
),
TessieButtonEntityDescription(
key="boombox", func=lambda: boombox, icon="mdi:volume-high"
),
TessieButtonEntityDescription(key="boombox", func=lambda: boombox),
)

View File

@ -1,22 +1,211 @@
{
"entity": {
"binary_sensor": {
"charge_state_scheduled_charging_pending": {
"default": "mdi:battery-clock"
},
"charge_state_trip_charging": {
"default": "mdi:car-clock"
},
"climate_state_auto_seat_climate_left": {
"default": "mdi:car-seat",
"state": {
"on": "mdi:car-seat-heater"
}
},
"climate_state_auto_seat_climate_right": {
"default": "mdi:car-seat",
"state": {
"on": "mdi:car-seat-heater"
}
},
"climate_state_auto_steering_wheel_heat": {
"default": "mdi:steering"
},
"vehicle_state_dashcam_state": {
"default": "mdi:camera-off",
"state": {
"on": "mdi:camera"
}
},
"vehicle_state_is_user_present": {
"default": "mdi:account-outline",
"state": {
"on": "mdi:account"
}
},
"vehicle_state_tpms_soft_warning_fl": {
"default": "mdi:tire",
"state": {
"on": "mdi:car-tire-alert"
}
},
"vehicle_state_tpms_soft_warning_fr": {
"default": "mdi:tire",
"state": {
"on": "mdi:car-tire-alert"
}
},
"vehicle_state_tpms_soft_warning_rl": {
"default": "mdi:tire",
"state": {
"on": "mdi:car-tire-alert"
}
},
"vehicle_state_tpms_soft_warning_rr": {
"default": "mdi:tire",
"state": {
"on": "mdi:car-tire-alert"
}
}
},
"button": {
"wake": {
"default": "mdi:sleep-off"
},
"flash_lights": {
"default": "mdi:flashlight"
},
"honk": {
"default": "mdi:bullhorn"
},
"trigger_homelink": {
"default": "mdi:garage"
},
"enable_keyless_driving": {
"default": "mdi:car-key"
},
"boombox": {
"default": "mdi:volume-high"
}
},
"climate": {
"primary": {
"state_attributes": {
"preset_mode": {
"state": {
"off": "mdi:fan",
"on": "mdi:thermometer-auto",
"dog": "mdi:paw",
"camp": "mdi:tent"
}
}
}
}
},
"device_tracker": {
"location": {
"default": "mdi:car",
"state": {
"not_home": "mdi:car-arrow-right"
}
},
"route": {
"default": "mdi:map-marker",
"state": {
"home": "mdi:home-map-marker"
}
}
},
"select": {
"climate_state_seat_heater_left": {
"default": "mdi:car-seat",
"state": {
"low": "mdi:car-seat-heater",
"medium": "mdi:car-seat-heater",
"high": "mdi:car-seat-heater"
}
},
"climate_state_seat_heater_right": {
"default": "mdi:car-seat",
"state": {
"low": "mdi:car-seat-heater",
"medium": "mdi:car-seat-heater",
"high": "mdi:car-seat-heater"
}
},
"climate_state_seat_heater_rear_left": {
"default": "mdi:car-seat",
"state": {
"low": "mdi:car-seat-heater",
"medium": "mdi:car-seat-heater",
"high": "mdi:car-seat-heater"
}
},
"climate_state_seat_heater_rear_center": {
"default": "mdi:car-seat",
"state": {
"low": "mdi:car-seat-heater",
"medium": "mdi:car-seat-heater",
"high": "mdi:car-seat-heater"
}
},
"climate_state_seat_heater_rear_right": {
"default": "mdi:car-seat",
"state": {
"low": "mdi:car-seat-heater",
"medium": "mdi:car-seat-heater",
"high": "mdi:car-seat-heater"
}
},
"climate_state_seat_heater_third_row_left": {
"default": "mdi:car-seat",
"state": {
"low": "mdi:car-seat-heater",
"medium": "mdi:car-seat-heater",
"high": "mdi:car-seat-heater"
}
},
"climate_state_seat_heater_third_row_right": {
"default": "mdi:car-seat",
"state": {
"low": "mdi:car-seat-heater",
"medium": "mdi:car-seat-heater",
"high": "mdi:car-seat-heater"
}
}
},
"sensor": {
"charge_state_charging_state": {
"default": "mdi:ev-station"
},
"charge_state_minutes_to_full_charge": {
"default": "mdi:clock-end"
},
"drive_state_shift_state": {
"default": "mdi:car-shift-pattern"
},
"vehicle_state_odometer": {
"default": "mdi:counter"
},
"drive_state_active_route_traffic_minutes_delay": {
"default": "mdi:clock-alert-outline"
},
"drive_state_active_route_miles_to_arrival": {
"default": "mdi:map-marker-distance"
},
"drive_state_active_route_minutes_to_arrival": {
"default": "mdi:timer-marker-outline"
},
"drive_state_active_route_destination": {
"default": "mdi:map-marker"
}
},
"binary_sensor": {
"climate_state_auto_seat_climate_left": {
"default": "mdi:car-seat-heater"
"switch": {
"climate_state_defrost_mode": {
"default": "mdi:car-defrost-front"
},
"climate_state_auto_seat_climate_right": {
"default": "mdi:car-seat-heater"
"vehicle_state_sentry_mode": {
"default": "mdi:radiobox-marked"
},
"climate_state_auto_steering_wheel_heat": {
"climate_state_steering_wheel_heater": {
"default": "mdi:steering"
},
"vehicle_state_valet_mode": {
"default": "mdi:bow-tie"
},
"charge_state_charge_enable_request": {
"default": "mdi:ev-plug-ccs2"
}
}
}

View File

@ -56,7 +56,6 @@ class TessieSensorEntityDescription(SensorEntityDescription):
DESCRIPTIONS: tuple[TessieSensorEntityDescription, ...] = (
TessieSensorEntityDescription(
key="charge_state_charging_state",
icon="mdi:ev-station",
options=list(TessieChargeStates.values()),
device_class=SensorDeviceClass.ENUM,
value_fn=lambda value: TessieChargeStates[cast(str, value)],

View File

@ -45,31 +45,26 @@ DESCRIPTIONS: tuple[TessieSwitchEntityDescription, ...] = (
key="charge_state_charge_enable_request",
on_func=lambda: start_charging,
off_func=lambda: stop_charging,
icon="mdi:ev-station",
),
TessieSwitchEntityDescription(
key="climate_state_defrost_mode",
on_func=lambda: start_defrost,
off_func=lambda: stop_defrost,
icon="mdi:snowflake",
),
TessieSwitchEntityDescription(
key="vehicle_state_sentry_mode",
on_func=lambda: enable_sentry_mode,
off_func=lambda: disable_sentry_mode,
icon="mdi:shield-car",
),
TessieSwitchEntityDescription(
key="vehicle_state_valet_mode",
on_func=lambda: enable_valet_mode,
off_func=lambda: disable_valet_mode,
icon="mdi:car-key",
),
TessieSwitchEntityDescription(
key="climate_state_steering_wheel_heater",
on_func=lambda: start_steering_wheel_heater,
off_func=lambda: stop_steering_wheel_heater,
icon="mdi:steering",
),
)

View File

@ -1165,7 +1165,7 @@
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.PRESENCE: 'presence'>,
'original_device_class': <BinarySensorDeviceClass.OCCUPANCY: 'occupancy'>,
'original_icon': None,
'original_name': 'User present',
'platform': 'tessie',
@ -1179,7 +1179,7 @@
# name: test_binary_sensors[binary_sensor.test_user_present-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'presence',
'device_class': 'occupancy',
'friendly_name': 'Test User present',
}),
'context': <ANY>,

View File

@ -22,7 +22,7 @@
'options': dict({
}),
'original_device_class': None,
'original_icon': 'mdi:flashlight',
'original_icon': None,
'original_name': 'Flash lights',
'platform': 'tessie',
'previous_unique_id': None,
@ -36,7 +36,6 @@
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Flash lights',
'icon': 'mdi:flashlight',
}),
'context': <ANY>,
'entity_id': 'button.test_flash_lights',
@ -68,7 +67,7 @@
'options': dict({
}),
'original_device_class': None,
'original_icon': 'mdi:garage',
'original_icon': None,
'original_name': 'Homelink',
'platform': 'tessie',
'previous_unique_id': None,
@ -82,7 +81,6 @@
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Homelink',
'icon': 'mdi:garage',
}),
'context': <ANY>,
'entity_id': 'button.test_homelink',
@ -114,7 +112,7 @@
'options': dict({
}),
'original_device_class': None,
'original_icon': 'mdi:bullhorn',
'original_icon': None,
'original_name': 'Honk horn',
'platform': 'tessie',
'previous_unique_id': None,
@ -128,7 +126,6 @@
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Honk horn',
'icon': 'mdi:bullhorn',
}),
'context': <ANY>,
'entity_id': 'button.test_honk_horn',
@ -160,7 +157,7 @@
'options': dict({
}),
'original_device_class': None,
'original_icon': 'mdi:car-key',
'original_icon': None,
'original_name': 'Keyless driving',
'platform': 'tessie',
'previous_unique_id': None,
@ -174,7 +171,6 @@
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Keyless driving',
'icon': 'mdi:car-key',
}),
'context': <ANY>,
'entity_id': 'button.test_keyless_driving',
@ -206,7 +202,7 @@
'options': dict({
}),
'original_device_class': None,
'original_icon': 'mdi:volume-high',
'original_icon': None,
'original_name': 'Play fart',
'platform': 'tessie',
'previous_unique_id': None,
@ -220,7 +216,6 @@
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Play fart',
'icon': 'mdi:volume-high',
}),
'context': <ANY>,
'entity_id': 'button.test_play_fart',
@ -252,7 +247,7 @@
'options': dict({
}),
'original_device_class': None,
'original_icon': 'mdi:sleep-off',
'original_icon': None,
'original_name': 'Wake',
'platform': 'tessie',
'previous_unique_id': None,
@ -266,7 +261,6 @@
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Wake',
'icon': 'mdi:sleep-off',
}),
'context': <ANY>,
'entity_id': 'button.test_wake',

View File

@ -505,7 +505,7 @@
'options': dict({
}),
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
'original_icon': 'mdi:ev-station',
'original_icon': None,
'original_name': 'Charging',
'platform': 'tessie',
'previous_unique_id': None,
@ -520,7 +520,6 @@
'attributes': ReadOnlyDict({
'device_class': 'enum',
'friendly_name': 'Test Charging',
'icon': 'mdi:ev-station',
'options': list([
'starting',
'charging',

View File

@ -22,7 +22,7 @@
'options': dict({
}),
'original_device_class': <SwitchDeviceClass.SWITCH: 'switch'>,
'original_icon': 'mdi:ev-station',
'original_icon': None,
'original_name': 'Charge',
'platform': 'tessie',
'previous_unique_id': None,
@ -37,7 +37,6 @@
'attributes': ReadOnlyDict({
'device_class': 'switch',
'friendly_name': 'Test Charge',
'icon': 'mdi:ev-station',
}),
'context': <ANY>,
'entity_id': 'switch.test_charge',
@ -69,7 +68,7 @@
'options': dict({
}),
'original_device_class': <SwitchDeviceClass.SWITCH: 'switch'>,
'original_icon': 'mdi:snowflake',
'original_icon': None,
'original_name': 'Defrost mode',
'platform': 'tessie',
'previous_unique_id': None,
@ -84,7 +83,6 @@
'attributes': ReadOnlyDict({
'device_class': 'switch',
'friendly_name': 'Test Defrost mode',
'icon': 'mdi:snowflake',
}),
'context': <ANY>,
'entity_id': 'switch.test_defrost_mode',
@ -116,7 +114,7 @@
'options': dict({
}),
'original_device_class': <SwitchDeviceClass.SWITCH: 'switch'>,
'original_icon': 'mdi:shield-car',
'original_icon': None,
'original_name': 'Sentry mode',
'platform': 'tessie',
'previous_unique_id': None,
@ -131,7 +129,6 @@
'attributes': ReadOnlyDict({
'device_class': 'switch',
'friendly_name': 'Test Sentry mode',
'icon': 'mdi:shield-car',
}),
'context': <ANY>,
'entity_id': 'switch.test_sentry_mode',
@ -163,7 +160,7 @@
'options': dict({
}),
'original_device_class': <SwitchDeviceClass.SWITCH: 'switch'>,
'original_icon': 'mdi:steering',
'original_icon': None,
'original_name': 'Steering wheel heater',
'platform': 'tessie',
'previous_unique_id': None,
@ -178,7 +175,6 @@
'attributes': ReadOnlyDict({
'device_class': 'switch',
'friendly_name': 'Test Steering wheel heater',
'icon': 'mdi:steering',
}),
'context': <ANY>,
'entity_id': 'switch.test_steering_wheel_heater',
@ -210,7 +206,7 @@
'options': dict({
}),
'original_device_class': <SwitchDeviceClass.SWITCH: 'switch'>,
'original_icon': 'mdi:car-key',
'original_icon': None,
'original_name': 'Valet mode',
'platform': 'tessie',
'previous_unique_id': None,
@ -225,7 +221,6 @@
'attributes': ReadOnlyDict({
'device_class': 'switch',
'friendly_name': 'Test Valet mode',
'icon': 'mdi:car-key',
}),
'context': <ANY>,
'entity_id': 'switch.test_valet_mode',
@ -239,7 +234,6 @@
'attributes': ReadOnlyDict({
'device_class': 'switch',
'friendly_name': 'Test Charge',
'icon': 'mdi:ev-station',
}),
'context': <ANY>,
'entity_id': 'switch.test_charge',
@ -253,7 +247,6 @@
'attributes': ReadOnlyDict({
'device_class': 'switch',
'friendly_name': 'Test Charge',
'icon': 'mdi:ev-station',
}),
'context': <ANY>,
'entity_id': 'switch.test_charge',