Skip to content

Commit

Permalink
CI: add yamllint to check yaml files for potential errors
Browse files Browse the repository at this point in the history
Clean up existing yaml files. A lot of whitespace inconsistencies
which mostly have no effect, a few indentation problems that might
have prevented mappings from working, many truthy values other than
true and false, some needing quoting as they were intended to be
strings. Also some blank entries for attributes that were filled in or
removed completely.

Too many changes to list the ones that might have had an impact.
  • Loading branch information
make-all committed Jan 27, 2024
1 parent 08e2679 commit e907c52
Show file tree
Hide file tree
Showing 251 changed files with 939 additions and 1,050 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Lint check
- name: Python lint
run: ruff check custom_components/tuya_local
- name: Check include order
- name: Python include order
run: ruff check --select I --diff .
- name: Check coding style
- name: Python coding style
run: ruff format --check --diff .
- name: YAML lint
run: yamllint -f parsable custom_components/tuya-local/devices
6 changes: 6 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---

extends: default
rules:
document-start: disable
new-lines: disable
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Dehumidifier
products:
- id: bf1872f920fbb07813iiwn
name: AlecoAir D25
- id: bf1872f920fbb07813iiwn
name: AlecoAir D25
primary_entity:
entity: humidifier
class: dehumidifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,4 +244,3 @@ secondary_entities:
- id: 113
name: color_disabled
type: boolean

12 changes: 6 additions & 6 deletions custom_components/tuya_local/devices/akai_dryer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ primary_entity:
icon: "mdi:tumble-dryer"
dps:
- id: 107
name: sensor # state
name: sensor
type: string
mapping:
- dps_val: "off"
Expand All @@ -34,14 +34,14 @@ secondary_entities:
icon: "mdi:play"
dps:
- id: 105
name: button # start
name: button
type: boolean
- entity: button
name: Pause
icon: "mdi:pause"
dps:
- id: 105
name: button # start
name: button
type: boolean
mapping:
- dps_val: false
Expand All @@ -51,7 +51,7 @@ secondary_entities:
icon: "mdi:tumble-dryer"
dps:
- id: 5
name: option # drying_mode
name: option
type: string
mapping:
- dps_val: "OFF"
Expand Down Expand Up @@ -91,7 +91,7 @@ secondary_entities:
icon: "mdi:signal"
dps:
- id: 101
name: option # drying_level
name: option
type: integer
mapping:
- dps_val: 0
Expand Down Expand Up @@ -128,6 +128,6 @@ secondary_entities:
class: duration
dps:
- id: 4
name: sensor # drying_time_left
name: sensor
type: integer
unit: min
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ primary_entity:
name: switch
type: boolean
mapping:
- dps_val: false
icon: "mdi:air-humidifier-off"
icon_priority: 1
- dps_val: true
icon: "mdi:air-humidifier"
icon_priority: 4
- dps_val: false
icon: "mdi:air-humidifier-off"
icon_priority: 1
- dps_val: true
icon: "mdi:air-humidifier"
icon_priority: 4
- id: 2
name: humidity
type: integer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,3 @@ secondary_entities:
- id: 9
type: boolean
name: switch

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ primary_entity:
dps:
- id: 1
name: switch
type: boolean
type: boolean
secondary_entities:
- entity: number
name: Countdown
Expand Down Expand Up @@ -56,9 +56,3 @@ secondary_entities:
optional: true
mapping:
- scale: 10






12 changes: 4 additions & 8 deletions custom_components/tuya_local/devices/asip_0622_planter.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Planter
products:
- id:
name: ASIP-0622 indoor planter
# - id:
# name: ASIP-0622 indoor planter
primary_entity:
entity: switch
icon: "mdi:sprout"
Expand Down Expand Up @@ -39,7 +39,6 @@ secondary_entities:
name: limits
# format: min,max
- entity: sensor
name:
class: humidity
dps:
- id: 7
Expand Down Expand Up @@ -111,7 +110,7 @@ secondary_entities:
type: integer
name: option
mapping:
- dps_val: -1
- dps_val: -1
value: Not planted
- dps_val: 0
value: Holy maiden fruit
Expand Down Expand Up @@ -336,7 +335,7 @@ secondary_entities:
type: string
name: option
mapping:
- dps_val: "0"
- dps_val: "0"
value: Auto
- dps_val: "1"
value: Manual
Expand All @@ -346,6 +345,3 @@ secondary_entities:
- id: 123
type: boolean
name: switch



6 changes: 2 additions & 4 deletions custom_components/tuya_local/devices/atomi_ceiling_fan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ secondary_entities:
name: switch
- id: 21
# docs give the standard white, colour, scene, music values, but this
# device does not have color or scene dps, so just leave it for monitoring
# device does not have color or scene dps, so just leave it for
# monitoring
name: work_mode
type: string
- id: 22
Expand Down Expand Up @@ -80,6 +81,3 @@ secondary_entities:
- id: 34
type: boolean
name: switch



Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,3 @@ secondary_entities:
- id: 103
type: boolean
name: sensor


42 changes: 21 additions & 21 deletions custom_components/tuya_local/devices/atomi_string_lights.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,27 @@ primary_entity:
name: rgbhsv
type: hex
format:
- name: r
bytes: 1
- name: g
bytes: 1
- name: b
bytes: 1
- name: h
bytes: 2
range:
min: 0
max: 360
- name: s
bytes: 1
range:
min: 0
max: 255
- name: v
bytes: 1
range:
min: 0
max: 255
- name: r
bytes: 1
- name: g
bytes: 1
- name: b
bytes: 1
- name: h
bytes: 2
range:
min: 0
max: 360
- name: s
bytes: 1
range:
min: 0
max: 255
- name: v
bytes: 1
range:
min: 0
max: 255
- id: 101
name: scene_data
type: hex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ secondary_entities:
dps:
- id: 101
type: integer
name: value
name: value
range:
min: 0
max: 99999
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,3 @@ secondary_entities:
range:
min: 10
max: 120

Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ secondary_entities:
icon: "mdi:hand-back-right-off"
- dps_val: false
icon: "mdi:hand-back-right"
- entity: switch
- entity: switch
name: Sound
category: config
icon: "mdi:music-note"
Expand All @@ -104,8 +104,8 @@ secondary_entities:
name: sensor
mapping:
- dps_val: 0
value: False
- value: True
value: false
- value: true
- entity: number
name: Temperature calibration
category: config
Expand Down Expand Up @@ -195,14 +195,14 @@ secondary_entities:
mapping:
- dps_val: "1"
value: "Weekday+Weekend"
- dps_val: "2"
- dps_val: "2"
value: "Mon-Sat+Sun"
- dps_val: "3"
value: "Daily"
- entity: switch
name: Output reverse
category: config
icon: "mdi:swap-horizontal"
icon: "mdi:swap-horizontal"
dps:
- id: 101
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ secondary_entities:
type: string
name: option
mapping:
- dps_val: "1"
- dps_val: "1"
value: Event
- dps_val: "2"
value: Continuous
Expand All @@ -139,6 +139,4 @@ secondary_entities:
dps:
- id: 231
type: string
name: sensor


name: sensor
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ primary_entity:
name: preset_mode
mapping:
- dps_val: true
value: eco
value: eco
- dps_val: false
value: comfort
- id: 102
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ primary_entity:
name: preset_mode
mapping:
- dps_val: true
value: eco
value: eco
- dps_val: false
value: comfort
- id: 102
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ primary_entity:
name: preset_mode
mapping:
- dps_val: true
value: eco
value: eco
- dps_val: false
value: comfort
- id: 102
Expand Down
2 changes: 1 addition & 1 deletion custom_components/tuya_local/devices/becool_heatpump.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ primary_entity:
- id: 5
type: string
name: mode
# unhide for debugging hidden: true
hidden: true
- id: 6
type: integer
name: temperature
Expand Down
16 changes: 8 additions & 8 deletions custom_components/tuya_local/devices/benexmart_blind_motor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ primary_entity:
mapping:
- invert: true
secondary_entities:
- entity: switch
category: config
name: Reversed
icon: "mdi:arrow-u-down-left"
dps:
- id: 5
type: boolean
name: switch
- entity: switch
category: config
name: Reversed
icon: "mdi:arrow-u-down-left"
dps:
- id: 5
type: boolean
name: switch
Loading

0 comments on commit e907c52

Please sign in to comment.