Skip to content

Commit

Permalink
Initial state select: standardise icons and translations.
Browse files Browse the repository at this point in the history
- migration added for naming variations

Issue #1708
  • Loading branch information
make-all committed Sep 25, 2024
1 parent 3ba20be commit 0633f52
Show file tree
Hide file tree
Showing 79 changed files with 392 additions and 275 deletions.
4 changes: 4 additions & 0 deletions custom_components/tuya_local/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,10 @@ def update_unique_id13_6(entity_entry):
"switch_sleep_mode": "switch_sleep",
"switch_sleep_timer": "switch_sleep",
"select_voice_language": "select_language",
"select_restore_power_state": "select_initial_state",
"select_power_on_state": "select_initial_state",
"select_restart_status": "select_initial_state",
"select_poweron_status": "select_initial_state",
}
for suffix, new_suffix in replacements.items():
if old_id.endswith(suffix):
Expand Down
11 changes: 5 additions & 6 deletions custom_components/tuya_local/devices/ard100_valve.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,16 @@ secondary_entities:
- scale: 1
- dps_val: null
- entity: select
name: Initial state
translation_key: initial_state
category: config
icon: "mdi:toggle-switch"
dps:
- id: 14
type: string
name: option
mapping:
- dps_val: "off"
value: "Off"
value: "off"
- dps_val: "on"
value: "On"
- dps_val: "memory"
value: "Last state"
value: "on"
- dps_val: memory
value: memory
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ secondary_entities:
step: 60
- entity: select
category: config
name: Restore power state
translation_key: initial_state
dps:
- id: 38
name: option
type: string
mapping:
- dps_val: memory
value: Remember Last Status
value: memory
- dps_val: "on"
value: "On"
value: "on"
- dps_val: "off"
value: "Off"
value: "off"
- entity: lock
category: config
translation_key: child_lock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,18 +427,17 @@ secondary_entities:
min: 0
max: 99
- entity: select
name: Initial state
icon: "mdi:toggle-switch"
translation_key: initial_state
category: config
dps:
- id: 138
type: string
name: option
mapping:
- dps_val: open
value: "Off"
value: "off"
- dps_val: close
value: "On"
value: "on"
- entity: switch
name: Prepaid
icon: "mdi:hand-coin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,18 +317,18 @@ secondary_entities:
max: 99
- entity: select
category: config
name: Initial state
translation_key: initial_state
dps:
- id: 138
type: string
name: option
mapping:
- dps_val: open
value: "On"
value: "on"
- dps_val: colse
value: "Off"
value: "off"
- dps_val: memory
value: Last state
value: memory
- entity: switch
name: Prepay
category: config
Expand Down
8 changes: 4 additions & 4 deletions custom_components/tuya_local/devices/atorch_s1wp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -512,18 +512,18 @@ secondary_entities:
max: 99
- entity: select
category: config
name: Poweron status
translation_key: initial_state
dps:
- id: 138
type: string
name: option
mapping:
- dps_val: open
value: "On"
value: "on"
- dps_val: colse
value: "Off"
value: "off"
- dps_val: memory
value: Memory
value: memory
- entity: number
category: config
name: Update interval
Expand Down
9 changes: 4 additions & 5 deletions custom_components/tuya_local/devices/aubess_1gang_switch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,19 @@ secondary_entities:
- scale: 60
step: 60
- entity: select
name: Restore power state
translation_key: initial_state
category: config
icon: "mdi:toggle-switch"
dps:
- id: 38
type: string
name: option
mapping:
- dps_val: "0"
value: "Off"
value: "off"
- dps_val: "1"
value: "On"
value: "on"
- dps_val: "2"
value: Remember last state
value: memory
- entity: sensor
name: Energy
category: diagnostic
Expand Down
9 changes: 4 additions & 5 deletions custom_components/tuya_local/devices/aubess_2gang_switch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,19 @@ secondary_entities:
- scale: 60
step: 60
- entity: select
name: Restore power state
translation_key: initial_state
category: config
icon: "mdi:toggle-switch"
dps:
- id: 38
type: string
name: option
mapping:
- dps_val: memory
value: Remember last state
value: memory
- dps_val: "on"
value: "On"
value: "on"
- dps_val: "off"
value: "Off"
value: "off"
- entity: select
name: Switch type
icon: "mdi:toggle-switch"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ secondary_entities:
name: calibration
optional: true
- entity: select
name: Initial state
icon: "mdi:toggle-switch"
translation_key: initial_state
category: config
dps:
- id: 38
Expand All @@ -188,7 +187,7 @@ secondary_entities:
- dps_val: "off"
value: "off"
- dps_val: "memory"
value: Last state
value: memory
- entity: lock
translation_key: child_lock
category: config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,19 @@ secondary_entities:
- scale: 60
step: 60
- entity: select
name: Initial state
icon: "mdi:toggle-switch"
translation_key: initial_state
category: config
dps:
- id: 38
type: string
name: option
mapping:
- dps_val: "on"
value: "On"
value: "on"
- dps_val: "off"
value: "Off"
value: "off"
- dps_val: memory
value: Last state
value: memory
- entity: select
name: Light mode
icon: "mdi:lightbulb"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,18 @@ secondary_entities:
step: 60
- entity: select
category: config
name: Initial state
icon: "mdi:toggle-switch"
translation_key: initial_state
dps:
- id: 14
type: string
name: option
mapping:
- dps_val: "on"
value: "On"
value: "on"
- dps_val: "off"
value: "Off"
- dps_val: "memory"
value: "Last State"
value: "off"
- dps_val: memory
value: memory
- entity: sensor
category: diagnostic
class: energy
Expand Down
9 changes: 4 additions & 5 deletions custom_components/tuya_local/devices/dimming_1ch_switch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,16 @@ secondary_entities:
- scale: 60
step: 60
- entity: select
name: Initial state
icon: "mdi:toggle-switch"
translation_key: initial_state
category: config
dps:
- id: 14
type: string
name: option
mapping:
- dps_val: "on"
value: "On"
value: "on"
- dps_val: "off"
value: "Off"
value: "off"
- dps_val: memory
value: Last state
value: memory
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ secondary_entities:
value: false
- value: true
- entity: select
name: Initial state
icon: "mdi:toggle-switch"
translation_key: initial_state
category: config
dps:
- id: 38
Expand All @@ -139,11 +138,11 @@ secondary_entities:
optional: true
mapping:
- dps_val: "on"
value: "On"
value: "on"
- dps_val: "off"
value: "Off"
- dps_val: "memory"
value: "Last state"
value: "off"
- dps_val: memory
value: memory
- dps_val: null
invalid: true
- entity: lock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ secondary_entities:
step: 60
- entity: select
category: config
name: Restore power state
translation_key: initial_state
dps:
- id: 14
name: option
type: string
mapping:
- dps_val: memory
value: Remember Last Status
value: memory
- dps_val: "on"
value: "On"
value: "on"
- dps_val: "off"
value: "Off"
value: "off"
- entity: select
name: Indicator Light
category: config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ primary_entity:
secondary_entities:
- entity: select
category: config
name: Restore power state
translation_key: initial_state
dps:
- id: 14
name: option
type: string
mapping:
- dps_val: memory
value: Remember Last Status
value: memory
- dps_val: "on"
value: "On"
value: "on"
- dps_val: "off"
value: "Off"
value: "off"
- entity: select
name: Indicator Light
category: config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,19 @@ secondary_entities:
- scale: 60
step: 60
- entity: select
name: Initial state
icon: "mdi:toggle-switch"
translation_key: initial_state
category: config
dps:
- id: 38
type: string
name: option
mapping:
- dps_val: "1"
value: "On"
value: "on"
- dps_val: "0"
value: "Off"
value: "off"
- dps_val: "2"
value: Last state
value: memory
- entity: select
name: Light mode
icon: "mdi:lightbulb"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,18 @@ secondary_entities:
type: integer
- entity: select
category: config
name: Initial state
icon: "mdi:toggle-switch"
translation_key: initial_state
dps:
- id: 38
name: option
type: string
mapping:
- dps_val: "on"
value: "On"
value: "on"
- dps_val: "off"
value: "Off"
value: "off"
- dps_val: memory
value: Last State
value: memory
- entity: number
name: Timer 1
translation_key: timer
Expand Down
Loading

0 comments on commit 0633f52

Please sign in to comment.