Store DPS as integers in config entry

Also require protocol_version to be a string and validate version to be
supported.
This commit is contained in:
Pierre Ståhl
2020-09-25 10:56:54 +02:00
committed by rospogrigio
parent 3259a4f654
commit 63090ba985
2 changed files with 3 additions and 13 deletions

View File

@@ -54,7 +54,7 @@ class TuyaDevice:
config_entry[CONF_DEVICE_ID],
config_entry[CONF_HOST],
config_entry[CONF_LOCAL_KEY],
config_entry[CONF_PROTOCOL_VERSION],
float(config_entry[CONF_PROTOCOL_VERSION]),
)
for entity in config_entry[CONF_ENTITIES]:
# this has to be done in case the device type is type_0d