Fix issues with new tile 2020 devices (#28133)

* Update meteoalertapi to version 0.1.6

* Fix tile to supporting 2020 tile devices
This commit is contained in:
rolfberkenbosch 2019-10-23 15:49:47 +02:00 committed by Aaron Bach
parent 852cbad965
commit 09b322b8a4
3 changed files with 7 additions and 5 deletions

View File

@ -43,7 +43,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
async def async_setup_scanner(hass, config, async_see, discovery_info=None): async def async_setup_scanner(hass, config, async_see, discovery_info=None):
"""Validate the configuration and return a Tile scanner.""" """Validate the configuration and return a Tile scanner."""
from pytile import Client from pytile import async_login
websession = aiohttp_client.async_get_clientsession(hass) websession = aiohttp_client.async_get_clientsession(hass)
@ -52,14 +52,16 @@ async def async_setup_scanner(hass, config, async_see, discovery_info=None):
) )
config_data = await hass.async_add_job(load_json, config_file) config_data = await hass.async_add_job(load_json, config_file)
if config_data: if config_data:
client = Client( client = await async_login(
config[CONF_USERNAME], config[CONF_USERNAME],
config[CONF_PASSWORD], config[CONF_PASSWORD],
websession, websession,
client_uuid=config_data["client_uuid"], client_uuid=config_data["client_uuid"],
) )
else: else:
client = Client(config[CONF_USERNAME], config[CONF_PASSWORD], websession) client = await async_login(
config[CONF_USERNAME], config[CONF_PASSWORD], websession
)
config_data = {"client_uuid": client.client_uuid} config_data = {"client_uuid": client.client_uuid}
await hass.async_add_job(save_json, config_file, config_data) await hass.async_add_job(save_json, config_file, config_data)

View File

@ -3,7 +3,7 @@
"name": "Tile", "name": "Tile",
"documentation": "https://www.home-assistant.io/integrations/tile", "documentation": "https://www.home-assistant.io/integrations/tile",
"requirements": [ "requirements": [
"pytile==2.0.6" "pytile==3.0.0"
], ],
"dependencies": [], "dependencies": [],
"codeowners": [ "codeowners": [

View File

@ -1600,7 +1600,7 @@ python_opendata_transport==0.1.4
pythonegardia==1.0.40 pythonegardia==1.0.40
# homeassistant.components.tile # homeassistant.components.tile
pytile==2.0.6 pytile==3.0.0
# homeassistant.components.touchline # homeassistant.components.touchline
pytouchline==0.7 pytouchline==0.7