Merge pull request #28932 from home-assistant/rc

0.102.1
This commit is contained in:
Paulus Schoutsen 2019-11-21 15:06:27 -08:00 committed by GitHub
commit 37f808f4d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 31 additions and 19 deletions

View File

@ -3,7 +3,7 @@
"name": "Home Assistant Frontend", "name": "Home Assistant Frontend",
"documentation": "https://www.home-assistant.io/integrations/frontend", "documentation": "https://www.home-assistant.io/integrations/frontend",
"requirements": [ "requirements": [
"home-assistant-frontend==20191119.2" "home-assistant-frontend==20191119.5"
], ],
"dependencies": [ "dependencies": [
"api", "api",

View File

@ -259,4 +259,4 @@ class CameraData:
@Throttle(MIN_TIME_BETWEEN_EVENT_UPDATES) @Throttle(MIN_TIME_BETWEEN_EVENT_UPDATES)
def update_event(self): def update_event(self):
"""Call the Netatmo API to update the events.""" """Call the Netatmo API to update the events."""
self.camera_data.updateEvent(home=self.home, cameratype=self.camera_type) self.camera_data.updateEvent(home=self.home, devicetype=self.camera_type)

View File

@ -3,7 +3,7 @@
"name": "Netatmo", "name": "Netatmo",
"documentation": "https://www.home-assistant.io/integrations/netatmo", "documentation": "https://www.home-assistant.io/integrations/netatmo",
"requirements": [ "requirements": [
"pyatmo==3.0.1" "pyatmo==3.1.0"
], ],
"dependencies": [ "dependencies": [
"webhook" "webhook"

View File

@ -155,14 +155,12 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
for module in all_module_infos.values(): for module in all_module_infos.values():
if module["module_name"] not in module_names: if module["module_name"] not in module_names:
continue continue
_LOGGER.debug(
"Adding module %s %s", module["module_name"], module["id"]
)
for condition in data.station_data.monitoredConditions( for condition in data.station_data.monitoredConditions(
moduleId=module["id"] moduleId=module["id"]
): ):
_LOGGER.debug(
"Adding %s %s",
module["module_name"],
data.station_data.moduleById(mid=module["id"]),
)
entities.append(NetatmoSensor(data, module, condition.lower())) entities.append(NetatmoSensor(data, module, condition.lower()))
return entities return entities
@ -200,18 +198,26 @@ class NetatmoSensor(Entity):
def __init__(self, netatmo_data, module_info, sensor_type): def __init__(self, netatmo_data, module_info, sensor_type):
"""Initialize the sensor.""" """Initialize the sensor."""
self.netatmo_data = netatmo_data self.netatmo_data = netatmo_data
module = self.netatmo_data.station_data.moduleById(mid=module_info["id"])
if module["type"] == "NHC": device = self.netatmo_data.station_data.moduleById(mid=module_info["id"])
if not device:
# Assume it's a station if module can't be found
device = self.netatmo_data.station_data.stationById(sid=module_info["id"])
if device["type"] == "NHC":
self.module_name = module_info["station_name"] self.module_name = module_info["station_name"]
else: else:
self.module_name = module_info["module_name"] self.module_name = (
f"{module_info['station_name']} {module_info['module_name']}"
)
self._name = f"{DOMAIN} {self.module_name} {SENSOR_TYPES[sensor_type][0]}" self._name = f"{DOMAIN} {self.module_name} {SENSOR_TYPES[sensor_type][0]}"
self.type = sensor_type self.type = sensor_type
self._state = None self._state = None
self._device_class = SENSOR_TYPES[self.type][3] self._device_class = SENSOR_TYPES[self.type][3]
self._icon = SENSOR_TYPES[self.type][2] self._icon = SENSOR_TYPES[self.type][2]
self._unit_of_measurement = SENSOR_TYPES[self.type][1] self._unit_of_measurement = SENSOR_TYPES[self.type][1]
self._module_type = module["type"] self._module_type = device["type"]
self._module_id = module_info["id"] self._module_id = module_info["id"]
self._unique_id = f"{self._module_id}-{self.type}" self._unique_id = f"{self._module_id}-{self.type}"

View File

@ -16,6 +16,7 @@ from homeassistant.const import (
CONF_TOKEN, CONF_TOKEN,
CONF_URL, CONF_URL,
CONF_VERIFY_SSL, CONF_VERIFY_SSL,
EVENT_HOMEASSISTANT_START,
EVENT_HOMEASSISTANT_STOP, EVENT_HOMEASSISTANT_STOP,
) )
from homeassistant.helpers import config_validation as cv from homeassistant.helpers import config_validation as cv
@ -164,12 +165,16 @@ async def async_setup_entry(hass, entry):
websocket = PlexWebsocket( websocket = PlexWebsocket(
plex_server.plex_server, update_plex, session=session, verify_ssl=verify_ssl plex_server.plex_server, update_plex, session=session, verify_ssl=verify_ssl
) )
hass.loop.create_task(websocket.listen())
hass.data[PLEX_DOMAIN][WEBSOCKETS][server_id] = websocket hass.data[PLEX_DOMAIN][WEBSOCKETS][server_id] = websocket
async def async_start_websocket_session(_):
await websocket.listen()
def close_websocket_session(_): def close_websocket_session(_):
websocket.close() websocket.close()
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_START, async_start_websocket_session)
unsub = hass.bus.async_listen_once( unsub = hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, close_websocket_session EVENT_HOMEASSISTANT_STOP, close_websocket_session
) )

View File

@ -68,6 +68,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
hass, PLEX_NEW_MP_SIGNAL.format(server_id), async_new_media_players hass, PLEX_NEW_MP_SIGNAL.format(server_id), async_new_media_players
) )
hass.data[PLEX_DOMAIN][DISPATCHERS][server_id].append(unsub) hass.data[PLEX_DOMAIN][DISPATCHERS][server_id].append(unsub)
_LOGGER.debug("New entity listener created")
@callback @callback

View File

@ -1,7 +1,7 @@
"""Constants used by Home Assistant components.""" """Constants used by Home Assistant components."""
MAJOR_VERSION = 0 MAJOR_VERSION = 0
MINOR_VERSION = 102 MINOR_VERSION = 102
PATCH_VERSION = "0" PATCH_VERSION = "1"
__short_version__ = "{}.{}".format(MAJOR_VERSION, MINOR_VERSION) __short_version__ = "{}.{}".format(MAJOR_VERSION, MINOR_VERSION)
__version__ = "{}.{}".format(__short_version__, PATCH_VERSION) __version__ = "{}.{}".format(__short_version__, PATCH_VERSION)
REQUIRED_PYTHON_VER = (3, 6, 1) REQUIRED_PYTHON_VER = (3, 6, 1)

View File

@ -11,7 +11,7 @@ contextvars==2.4;python_version<"3.7"
cryptography==2.8 cryptography==2.8
distro==1.4.0 distro==1.4.0
hass-nabucasa==0.29 hass-nabucasa==0.29
home-assistant-frontend==20191119.2 home-assistant-frontend==20191119.5
importlib-metadata==0.23 importlib-metadata==0.23
jinja2>=2.10.3 jinja2>=2.10.3
netdisco==2.6.0 netdisco==2.6.0

View File

@ -655,7 +655,7 @@ hole==0.5.0
holidays==0.9.11 holidays==0.9.11
# homeassistant.components.frontend # homeassistant.components.frontend
home-assistant-frontend==20191119.2 home-assistant-frontend==20191119.5
# homeassistant.components.zwave # homeassistant.components.zwave
homeassistant-pyozw==0.1.4 homeassistant-pyozw==0.1.4
@ -1105,7 +1105,7 @@ pyalmond==0.0.2
pyarlo==0.2.3 pyarlo==0.2.3
# homeassistant.components.netatmo # homeassistant.components.netatmo
pyatmo==3.0.1 pyatmo==3.1.0
# homeassistant.components.atome # homeassistant.components.atome
pyatome==0.1.1 pyatome==0.1.1

View File

@ -222,7 +222,7 @@ hole==0.5.0
holidays==0.9.11 holidays==0.9.11
# homeassistant.components.frontend # homeassistant.components.frontend
home-assistant-frontend==20191119.2 home-assistant-frontend==20191119.5
# homeassistant.components.zwave # homeassistant.components.zwave
homeassistant-pyozw==0.1.4 homeassistant-pyozw==0.1.4