Skip to content

Commit

Permalink
Child lock: Move name and icon to translations
Browse files Browse the repository at this point in the history
Issue #1579
  • Loading branch information
make-all committed Feb 27, 2024
1 parent 9cba602 commit bbafb21
Show file tree
Hide file tree
Showing 196 changed files with 286 additions and 589 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@ secondary_entities:
value: false
- value: true
- entity: lock
name: Child lock
translation_key: child_lock
category: config
icon: "mdi:hand-back-right-off"
dps:
- id: 16
type: boolean
Expand Down
13 changes: 13 additions & 0 deletions custom_components/tuya_local/devices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ behaviour.
For most entities, it will alter the default icon, and for binary sensors
also the state that off and on values translate to in the UI.

### `translation_key` / `translation_only_key`

*Optional*

A key used to define strings and icons for this entity. If this is used,
the name can be omited and instead defined in the translations files.

`translation_key` will be used to generate IDs when there is no name defined.
If the intention is to have an unnamed entity, or to inherit from class, then
use `translation_only_key` instead (this is mostly useful to retain
backward compatibility where `translation_key` is used to define icons and
attribute strings but not the entity name.

### `category`

*Optional.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,12 @@ secondary_entities:
- dps_val: true
icon: "mdi:sleep"
- entity: lock
name: Child lock
translation_key: child_lock
category: config
dps:
- id: 16
type: boolean
name: lock
mapping:
- dps_val: false
icon: "mdi:hand-back-right"
- dps_val: true
icon: "mdi:hand-back-right-off"
- entity: binary_sensor
class: problem
name: Tank full
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,12 @@ secondary_entities:
- dps_val: null
invalid: true
- entity: lock
name: Child lock
translation_key: child_lock
category: config
dps:
- id: 7
type: boolean
name: lock
mapping:
- dps_val: false
icon: "mdi:hand-back-right"
- dps_val: true
icon: "mdi:hand-back-right-off"
- entity: select
name: Countdown
icon: "mdi:timer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,12 @@ secondary_entities:
value: false
- value: true
- entity: lock
name: Child lock
translation_key: child_lock
category: config
dps:
- id: 14
type: boolean
name: lock
mapping:
- dps_val: true
icon: "mdi:hand-back-right-off"
- dps_val: false
icon: "mdi:hand-back-right"
- entity: select
name: Timer
icon: "mdi:timer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,12 @@ secondary_entities:
value: false
- value: true
- entity: lock
name: Child lock
translation_key: child_lock
category: config
dps:
- id: 14
type: boolean
name: lock
mapping:
- dps_val: true
icon: "mdi:hand-back-right-off"
- dps_val: false
icon: "mdi:hand-back-right"
- entity: select
name: Timer
icon: "mdi:timer"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/tuya_local/devices/anko_fan.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Anko fan
primary_entity:
entity: fan
translation_key: fan_with_presets
translation_only_key: fan_with_presets
dps:
- id: 1
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ products:
- id: rklgm99ldz4unh5s
primary_entity:
entity: fan
translation_key: fan_with_presets
translation_only_key: fan_with_presets
dps:
- id: 1
name: switch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ products:
name: Arlec 19-speed industrial wall fan
primary_entity:
entity: fan
translation_key: fan_with_presets
translation_only_key: fan_with_presets
dps:
- id: 1
name: switch
Expand Down
2 changes: 1 addition & 1 deletion custom_components/tuya_local/devices/arlec_6speed_fan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ products:
name: Arlec 45cm black floor fan
primary_entity:
entity: fan
translation_key: fan_with_presets
translation_only_key: fan_with_presets
dps:
- id: 1
name: switch
Expand Down
2 changes: 1 addition & 1 deletion custom_components/tuya_local/devices/arlec_fan.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: ARLEC Grid Connect Fan
primary_entity:
entity: fan
translation_key: fan_with_presets
translation_only_key: fan_with_presets
dps:
- id: 1
name: switch
Expand Down
2 changes: 1 addition & 1 deletion custom_components/tuya_local/devices/arlec_fan_light.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: ARLEC fan with light
primary_entity:
entity: fan
translation_key: fan_with_presets
translation_only_key: fan_with_presets
dps:
- id: 1
name: switch
Expand Down
3 changes: 1 addition & 2 deletions custom_components/tuya_local/devices/arlec_panel_heater.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ primary_entity:

secondary_entities:
- entity: lock
name: Child lock
icon: "mdi:hand-back-right-off"
translation_key: child_lock
category: config
dps:
- id: 6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ primary_entity:
value: unknown
secondary_entities:
- entity: lock
name: Child lock
icon: "mdi:hand-back-right-off"
translation_key: child_lock
category: config
dps:
- id: 7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ secondary_entities:
value: "Off"
- entity: lock
category: config
name: Child lock
icon: "mdi:hand-back-right-off"
translation_key: child_lock
dps:
- id: 41
name: lock
Expand Down
2 changes: 1 addition & 1 deletion custom_components/tuya_local/devices/aspen_asp200_fan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Aspen fan
legacy_type: aspen_fan
primary_entity:
entity: fan
translation_key: fan_with_presets
translation_only_key: fan_with_presets
dps:
- id: 1
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ products:
name: Atomi 52 inch ceiling fan
primary_entity:
entity: fan
translation_key: fan_with_presets
translation_only_key: fan_with_presets
dps:
- id: 60
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ secondary_entities:
name: button
optional: true
- entity: lock
name: Child lock
icon: "mdi:hand-back-right-off"
translation_key: child_lock
category: config
dps:
- id: 40
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ products:
name: Avatto WT200W-EH
primary_entity:
entity: climate
translation_key: thermostat
translation_only_key: thermostat
dps:
- id: 1
name: hvac_mode
Expand Down Expand Up @@ -74,18 +74,12 @@ primary_entity:
type: integer
secondary_entities:
- entity: lock
name: Child lock
icon: "mdi:hand-back-right-off"
translation_key: child_lock
category: config
dps:
- id: 8
name: lock
type: boolean
mapping:
- dps_val: true
icon: "mdi:hand-back-right-off"
- dps_val: false
icon: "mdi:hand-back-right"
- entity: switch
name: Sound
category: config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,12 @@ primary_entity:
name: unknown_110
secondary_entities:
- entity: lock
name: Child lock
translation_key: child_lock
category: config
dps:
- id: 6
type: boolean
name: lock
mapping:
- dps_val: true
icon: "mdi:hand-back-right-off"
- dps_val: false
icon: "mdi:hand-back-right"
- entity: sensor
name: External temperature
class: temperature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,12 @@ primary_entity:
name: unknown_116
secondary_entities:
- entity: lock
name: Child lock
translation_key: child_lock
category: config
dps:
- id: 6
type: boolean
name: lock
mapping:
- dps_val: true
icon: "mdi:hand-back-right-off"
- dps_val: false
icon: "mdi:hand-back-right"
- entity: sensor
name: External temperature
class: temperature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,12 @@ primary_entity:
value: low
secondary_entities:
- entity: lock
name: Child lock
translation_key: child_lock
category: config
dps:
- id: 6
type: boolean
name: lock
mapping:
- dps_val: true
icon: "mdi:hand-back-right-off"
- dps_val: false
icon: "mdi:hand-back-right"
- entity: select
name: Schedule
icon: "mdi:calendar-clock"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ products:
- id: drwezxukumr9ohuh
primary_entity:
entity: climate
translation_key: thermostat
translation_only_key: thermostat
dps:
- id: 2
name: temperature
Expand Down Expand Up @@ -51,17 +51,12 @@ primary_entity:
value: "on"
secondary_entities:
- entity: lock
name: Child lock
translation_key: child_lock
category: config
dps:
- id: 7
name: lock
type: boolean
mapping:
- dps_val: true
icon: "mdi:hand-back-right-off"
- dps_val: false
icon: "mdi:hand-back-right"
- entity: light
name: Display
category: config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ products:
legacy_type: beca_bhp6000_thermostat
primary_entity:
entity: climate
translation_key: thermostat
translation_only_key: thermostat
dps:
- id: 2
name: temperature
Expand Down Expand Up @@ -52,17 +52,12 @@ primary_entity:
value: "on"
secondary_entities:
- entity: lock
name: Child lock
translation_key: child_lock
category: config
dps:
- id: 7
name: lock
type: boolean
mapping:
- dps_val: true
icon: "mdi:hand-back-right-off"
- dps_val: false
icon: "mdi:hand-back-right"
- entity: light
name: Display
category: config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ products:
- id: drwezxukumr9ohuh
primary_entity:
entity: climate
translation_key: thermostat
translation_only_key: thermostat
dps:
- id: 2
name: temperature
Expand Down Expand Up @@ -382,17 +382,12 @@ primary_entity:
value: "on"
secondary_entities:
- entity: lock
name: Child lock
translation_key: child_lock
category: config
dps:
- id: 7
name: lock
type: boolean
mapping:
- dps_val: true
icon: "mdi:hand-back-right-off"
- dps_val: false
icon: "mdi:hand-back-right"
- entity: light
name: Display
category: config
Expand Down
Loading

0 comments on commit bbafb21

Please sign in to comment.