Clean up YAML examples in code files
This commit is contained in:
committed by
rospogrigio
parent
63090ba985
commit
d22d081335
@@ -1,4 +1,51 @@
|
|||||||
"""The LocalTuya integration integration."""
|
"""The LocalTuya integration integration.
|
||||||
|
|
||||||
|
Sample YAML config with all supported entity types (default values
|
||||||
|
are pre-filled for optional fields):
|
||||||
|
|
||||||
|
localtuya:
|
||||||
|
- host: 192.168.1.x
|
||||||
|
device_id: xxxxx
|
||||||
|
local_key: xxxxx
|
||||||
|
friendly_name: Tuya Device
|
||||||
|
protocol_version: "3.3"
|
||||||
|
entities:
|
||||||
|
- platform: binary_sensor
|
||||||
|
friendly_name: Plug Status
|
||||||
|
id: 1
|
||||||
|
device_class: power
|
||||||
|
state_on: "true" # Optional
|
||||||
|
state_off: "false" # Optional
|
||||||
|
|
||||||
|
- platform: cover
|
||||||
|
friendly_name: Device Cover
|
||||||
|
id: 2
|
||||||
|
open_cmd: "on" # Optional
|
||||||
|
close_cmd: "off" # Optional
|
||||||
|
stop_cmd: "stop" # Optional
|
||||||
|
|
||||||
|
- platform: fan
|
||||||
|
friendly_name: Device Fan
|
||||||
|
id: 3
|
||||||
|
|
||||||
|
- platform: light
|
||||||
|
friendly_name: Device Light
|
||||||
|
id: 4
|
||||||
|
|
||||||
|
- platform: sensor
|
||||||
|
friendly_name: Plug Voltage
|
||||||
|
id: 20
|
||||||
|
scaling: 0.1 # Optional
|
||||||
|
device_class: voltage # Optional
|
||||||
|
unit_of_measurement: "V" # Optional
|
||||||
|
|
||||||
|
- platform: switch
|
||||||
|
friendly_name: Plug
|
||||||
|
id: 1
|
||||||
|
current: 18 # Optional
|
||||||
|
current_consumption: 19 # Optional
|
||||||
|
voltage: 20 # Optional
|
||||||
|
"""
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@@ -1,20 +1,4 @@
|
|||||||
"""
|
"""Platform to present any Tuya DP as a binary sensor."""
|
||||||
Platform to prsent any Tuya DP as a binary sensor.
|
|
||||||
|
|
||||||
Sample config yaml
|
|
||||||
|
|
||||||
sensor:
|
|
||||||
- platform: localtuya
|
|
||||||
host: 192.168.0.1
|
|
||||||
local_key: 1234567891234567
|
|
||||||
device_id: 12345678912345671234
|
|
||||||
friendly_name: Current
|
|
||||||
protocol_version: 3.3
|
|
||||||
id: 18
|
|
||||||
state_on: "true" (optional, default is "true")
|
|
||||||
state_off: "false" (optional, default is "false")
|
|
||||||
device_class: current
|
|
||||||
"""
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
@@ -1,23 +1,4 @@
|
|||||||
"""
|
"""Platform to locally control Tuya-based cover devices."""
|
||||||
Simple platform to locally control Tuya-based cover devices.
|
|
||||||
|
|
||||||
Sample config yaml:
|
|
||||||
|
|
||||||
cover:
|
|
||||||
- platform: localtuya #REQUIRED
|
|
||||||
host: 192.168.0.123 #REQUIRED
|
|
||||||
local_key: 1234567891234567 #REQUIRED
|
|
||||||
device_id: 123456789123456789abcd #REQUIRED
|
|
||||||
name: cover_guests #REQUIRED
|
|
||||||
friendly_name: Cover guests #REQUIRED
|
|
||||||
protocol_version: 3.3 #REQUIRED
|
|
||||||
id: 1 #OPTIONAL
|
|
||||||
icon: mdi:blinds #OPTIONAL
|
|
||||||
open_cmd: open #OPTIONAL, default is 'on'
|
|
||||||
close_cmd: close #OPTIONAL, default is 'off'
|
|
||||||
stop_cmd: stop #OPTIONAL, default is 'stop'
|
|
||||||
|
|
||||||
"""
|
|
||||||
import logging
|
import logging
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
|
@@ -1,19 +1,4 @@
|
|||||||
"""
|
"""Platform to locally control Tuya-based fan devices."""
|
||||||
Simple platform to control LOCALLY Tuya cover devices.
|
|
||||||
|
|
||||||
Sample config yaml
|
|
||||||
|
|
||||||
fan:
|
|
||||||
- platform: localtuya
|
|
||||||
host: 192.168.0.123
|
|
||||||
local_key: 1234567891234567
|
|
||||||
device_id: 123456789123456789abcd
|
|
||||||
name: fan guests
|
|
||||||
friendly_name: fan guests
|
|
||||||
protocol_version: 3.3
|
|
||||||
id: 1
|
|
||||||
|
|
||||||
"""
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.fan import (
|
from homeassistant.components.fan import (
|
||||||
|
@@ -1,16 +1,4 @@
|
|||||||
"""
|
"""Platform to locally control Tuya-based light devices."""
|
||||||
Simple platform to control LOCALLY Tuya light devices.
|
|
||||||
|
|
||||||
Sample config yaml
|
|
||||||
|
|
||||||
light:
|
|
||||||
- platform: localtuya
|
|
||||||
host: 192.168.0.1
|
|
||||||
local_key: 1234567891234567
|
|
||||||
device_id: 12345678912345671234
|
|
||||||
friendly_name: This Light
|
|
||||||
protocol_version: 3.3
|
|
||||||
"""
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.const import CONF_ID
|
from homeassistant.const import CONF_ID
|
||||||
|
@@ -1,19 +1,4 @@
|
|||||||
"""
|
"""Platform to present any Tuya DP as a sensor."""
|
||||||
Platform to prsent any Tuya DP as a sensor.
|
|
||||||
|
|
||||||
Sample config yaml
|
|
||||||
|
|
||||||
sensor:
|
|
||||||
- platform: localtuya
|
|
||||||
host: 192.168.0.1
|
|
||||||
local_key: 1234567891234567
|
|
||||||
device_id: 12345678912345671234
|
|
||||||
friendly_name: Current
|
|
||||||
protocol_version: 3.3
|
|
||||||
id: 18
|
|
||||||
unit_of_measurement: mA
|
|
||||||
device_class: current
|
|
||||||
"""
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
@@ -1,29 +1,4 @@
|
|||||||
"""
|
"""Platform to locally control Tuya-based switch devices."""
|
||||||
Simple platform to control LOCALLY Tuya switch devices.
|
|
||||||
|
|
||||||
Sample config yaml
|
|
||||||
|
|
||||||
switch:
|
|
||||||
- platform: localtuya
|
|
||||||
host: 192.168.0.1
|
|
||||||
local_key: 1234567891234567
|
|
||||||
device_id: 12345678912345671234
|
|
||||||
name: tuya_01
|
|
||||||
friendly_name: tuya_01
|
|
||||||
protocol_version: 3.3
|
|
||||||
switches:
|
|
||||||
sw01:
|
|
||||||
name: main_plug
|
|
||||||
friendly_name: Main Plug
|
|
||||||
id: 1
|
|
||||||
current: 18
|
|
||||||
current_consumption: 19
|
|
||||||
voltage: 20
|
|
||||||
sw02:
|
|
||||||
name: usb_plug
|
|
||||||
friendly_name: USB Plug
|
|
||||||
id: 7
|
|
||||||
"""
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
Reference in New Issue
Block a user