Skip to content

Commit

Permalink
Tests: Add a schema check to device config tests
Browse files Browse the repository at this point in the history
Schema check detects typos, wrong indentation, misplaced attributes,
and use of imaginary attributes that contributers made up on the spot.

Many errors detected by this.
  • Loading branch information
make-all committed Feb 29, 2024
1 parent cddef4d commit a52aeca
Show file tree
Hide file tree
Showing 62 changed files with 256 additions and 180 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ secondary_entities:
value: true
- entity: sensor
class: battery
unit: "%"
dps:
- id: 2
type: integer
name: sensor
unit: "%"
- entity: binary_sensor
class: plug
dps:
Expand Down
3 changes: 1 addition & 2 deletions custom_components/tuya_local/devices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ listing can also have an optional `name`, which is intended to specify the
specific brand and model name or number of the matching device. In future
when local discovery is implemented to discover products by id, this name will
be displayed on discovery, and be available as manufacturer and model info
in device settings (so probably in future name will be split into manufacturer
and model, but for now, putting them together as name is OK).
in device settings.

### `primary_entity`

Expand Down
4 changes: 2 additions & 2 deletions custom_components/tuya_local/devices/agl_ultramagic_lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ secondary_entities:
range:
min: 1
max: 1200
unit: s
unit: s
- entity: number
category: config
icon: "mdi:alarm"
Expand All @@ -117,4 +117,4 @@ secondary_entities:
range:
min: 0
max: 100
unit: s
unit: s
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Planter
products:
#products:
# - id:
# name: ASIP-0622 indoor planter
primary_entity:
Expand Down
1 change: 0 additions & 1 deletion custom_components/tuya_local/devices/aspen_asp200_fan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ secondary_entities:
name: current_temperature
type: integer
unit: F
icon: "mdi:thermometer"
- entity: light
name: Display
category: config
Expand Down
1 change: 0 additions & 1 deletion custom_components/tuya_local/devices/atorch_s1wp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,6 @@ secondary_entities:
- id: 137
type: integer
name: value
mode: box
unit: min
range:
min: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Irrigation system
products:
- id: 2ak7r2culspkc7hx
model: RainPoint TTP106W
manufacturer: Aubess
name: Aubess RainPoint TTP106W
primary_entity:
entity: switch
icon: "mdi:pipe-valve"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ secondary_entities:
max: 5
- entity: number
name: High limit temperature ceiling
icon: "mdi:thermometer-alert"
category: config
dps:
- id: 19
name: value
type: integer
icon: "mdi:thermometer-alert"
range:
min: 45
max: 70
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ secondary_entities:
name: High temperature limit
category: config
class: temperature
icon: "mdi:thermometer"
dps:
- id: 19
type: integer
Expand All @@ -158,7 +157,6 @@ secondary_entities:
name: value
type: integer
unit: C
icon: "mdi:thermometer"
range:
min: 50
max: 10000
Expand Down
6 changes: 3 additions & 3 deletions custom_components/tuya_local/devices/ble_hu06_lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ secondary_entities:
range:
min: 10
max: 180
mapping:
- step: 10
unit: s
mapping:
- step: 10
unit: s
- entity: binary_sensor
class: door
category: diagnostic
Expand Down
2 changes: 1 addition & 1 deletion custom_components/tuya_local/devices/ble_water_valve.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ products:
- id: bfc513e1f9d4d259a10wzu
name: Diivoo Water Timer Valve WT-03
- id: nxquc5lb
model: SOP10
name: SOP10
- id: so5ybnw9
name: BWC-495.bt Royal Gardineer
primary_entity:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Bresser 7-in-1 ClimateConnect Tuya Smart Home Weather Centre
# https://www.bresser.de/en/Weather-Time/BRESSER-7-in-1-ClimateConnect-Tuya-Smart-Home-Weather-Centre.html
name: Bresser weather station
name: Weather station
products:
- id: 8qk6p78udvbjwlof
model: C6085A
name: Bresser C6085A
primary_entity:
entity: sensor
name: Indoor temperature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ secondary_entities:
class: problem
name: Tank full
icon: "mdi:cup-outline"
icon-priority: 2
icon_priority: 2
dps:
- id: 11
type: bitfield
Expand All @@ -165,7 +165,7 @@ secondary_entities:
- dps_val: 8
value: true
icon: "mdi:cup-water"
icon-priority: 1
icon_priority: 1
- value: false
- entity: binary_sensor
name: Defrost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ products:
primary_entity:
entity: fan
translation_only_key: fan_with_presets
icon: "mdi:air-purifier"
dps:
- id: 1
name: switch
type: boolean
icon: "mdi:air-purifier"
- id: 3
name: preset_mode
type: string
Expand Down
1 change: 0 additions & 1 deletion custom_components/tuya_local/devices/catit_pet_feeder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ secondary_entities:
- id: 101
name: sensor
type: integer
type: integer
- entity: button
class: restart
name: Factory reset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ primary_entity:
range:
min: 30
max: 75
step: 5
mapping:
- step: 5
- id: 14
name: current_humidity
type: integer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,19 @@ secondary_entities:
- id: 9
name: switch
type: boolean
constraint: mode
conditions:
- dps_val: auto
invalid: true
- dps_val: wind
invalid: true
- dps_val: hot
invalid: true
mapping:
- constraint: mode
conditions:
- dps_val: auto
invalid: true
- dps_val: wind
invalid: true
- dps_val: hot
invalid: true
- id: 4
name: mode
type: string
hidden: true
- entity: switch
name: Ioniser
category: config
Expand Down
3 changes: 1 addition & 2 deletions custom_components/tuya_local/devices/diivoo_wt05.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
name: Dual water timer
products:
- id: fdrbxxbg
manufacturer: Diivoo
model: WT-05
name: Diivoo WT-05
primary_entity:
entity: switch
icon: "mdi:pipe-valve"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
# Tuya Smart Life WiFi Motorized Swing Gate Sliding Gate Opener Dry Contact
# 110V 240V Voice Control with Alexa Google Home
# https://www.aliexpress.com/item/1005003913566298.html
name: WiFi garage opener
name: Garage opener
products:
- id: 1wwbzczt9hrtwqjr
name: Dongguan garage door
model: PJ-WGDOOR01
name: Dongguan PJ-WGDOOR01
primary_entity:
entity: cover
class: garage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ secondary_entities:
name: sensor
unit: kW
class: measurement
scale: 10000
mapping:
- scale: 10000
- entity: binary_sensor
name: Fault
class: problem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ secondary_entities:
type: base64
unit: V
class: measurement
persist: true
name: sensor
mapping:
- mask: "FFFF000000000000"
Expand All @@ -49,7 +48,6 @@ secondary_entities:
optional: true
force: true
type: base64
persist: true
unit: A
name: sensor
mapping:
Expand All @@ -64,7 +62,6 @@ secondary_entities:
force: true
type: base64
unit: kW
persist: true
name: sensor
mapping:
- mask: "0000000000FFFFFF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ secondary_entities:
- entity: number
name: Temperature correction
category: config
icon: "mdi:wrench-clock"
mode: slider
dps:
- id: 27
name: value
type: integer
unit: C
icon: "mdi:wrench-clock"
range:
min: -100
max: 100
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Garden irrigation system
products:
- id: xnajzurgqo1ugohn
model: ITV103W
manufacturer: Garza
name: Garza ITV103W
primary_entity:
entity: switch
icon: "mdi:watering-can"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ secondary_entities:
name: Clear energy
class: restart
category: config
hidden: true
dps:
- id: 16
type: boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Tap timer
products:
- id: zrsgzc8jktsricjj
model: WX1
manufacturer: Holman
name: Holman WX1
# DP decoding thanks to funtastix
primary_entity:
entity: switch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Tap timer
products:
- id: wfchjk5vc9bysjtk
model: WX2
manufacturer: Holman
name: Holman WX2
primary_entity:
entity: switch
name: Manual 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Irrigation Controller
products:
- id: 3c8bxnseywh7radc
model: WX8
manufacturer: Holman
name: Holman WX8
primary_entity:
entity: binary_sensor
class: running
Expand Down
Loading

0 comments on commit a52aeca

Please sign in to comment.