Tuya fix login problem and add login platform param (#16058)
* add a platform param to distinguish different app's account. * fix requirements
This commit is contained in:
parent
81d3161a5e
commit
21b88f2fe8
2 changed files with 7 additions and 5 deletions
|
@ -10,14 +10,14 @@ import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD)
|
from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD, CONF_PLATFORM)
|
||||||
from homeassistant.helpers import discovery
|
from homeassistant.helpers import discovery
|
||||||
from homeassistant.helpers.dispatcher import (
|
from homeassistant.helpers.dispatcher import (
|
||||||
dispatcher_send, async_dispatcher_connect)
|
dispatcher_send, async_dispatcher_connect)
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
from homeassistant.helpers.event import track_time_interval
|
from homeassistant.helpers.event import track_time_interval
|
||||||
|
|
||||||
REQUIREMENTS = ['tuyapy==0.1.2']
|
REQUIREMENTS = ['tuyapy==0.1.3']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -45,7 +45,8 @@ CONFIG_SCHEMA = vol.Schema({
|
||||||
DOMAIN: vol.Schema({
|
DOMAIN: vol.Schema({
|
||||||
vol.Required(CONF_PASSWORD): cv.string,
|
vol.Required(CONF_PASSWORD): cv.string,
|
||||||
vol.Required(CONF_USERNAME): cv.string,
|
vol.Required(CONF_USERNAME): cv.string,
|
||||||
vol.Required(CONF_COUNTRYCODE): cv.string
|
vol.Required(CONF_COUNTRYCODE): cv.string,
|
||||||
|
vol.Optional(CONF_PLATFORM, default='tuya'): cv.string,
|
||||||
})
|
})
|
||||||
}, extra=vol.ALLOW_EXTRA)
|
}, extra=vol.ALLOW_EXTRA)
|
||||||
|
|
||||||
|
@ -58,9 +59,10 @@ def setup(hass, config):
|
||||||
username = config[DOMAIN][CONF_USERNAME]
|
username = config[DOMAIN][CONF_USERNAME]
|
||||||
password = config[DOMAIN][CONF_PASSWORD]
|
password = config[DOMAIN][CONF_PASSWORD]
|
||||||
country_code = config[DOMAIN][CONF_COUNTRYCODE]
|
country_code = config[DOMAIN][CONF_COUNTRYCODE]
|
||||||
|
platform = config[DOMAIN][CONF_PLATFORM]
|
||||||
|
|
||||||
hass.data[DATA_TUYA] = tuya
|
hass.data[DATA_TUYA] = tuya
|
||||||
tuya.init(username, password, country_code)
|
tuya.init(username, password, country_code, platform)
|
||||||
hass.data[DOMAIN] = {
|
hass.data[DOMAIN] = {
|
||||||
'entities': {}
|
'entities': {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1392,7 +1392,7 @@ tplink==0.2.1
|
||||||
transmissionrpc==0.11
|
transmissionrpc==0.11
|
||||||
|
|
||||||
# homeassistant.components.tuya
|
# homeassistant.components.tuya
|
||||||
tuyapy==0.1.2
|
tuyapy==0.1.3
|
||||||
|
|
||||||
# homeassistant.components.twilio
|
# homeassistant.components.twilio
|
||||||
twilio==5.7.0
|
twilio==5.7.0
|
||||||
|
|
Loading…
Add table
Reference in a new issue