This commit is contained in:
Paulus Schoutsen
2019-07-31 12:25:30 -07:00
parent da05dfe708
commit 4de97abc3a
2676 changed files with 163166 additions and 140084 deletions

View File

@@ -4,12 +4,13 @@ from homeassistant.core import callback
from homeassistant.helpers.entity import Entity
from .const import (
SIGNAL_WEBSOCKET_CONNECTED, SIGNAL_WEBSOCKET_DISCONNECTED,
DATA_CONNECTIONS)
SIGNAL_WEBSOCKET_CONNECTED,
SIGNAL_WEBSOCKET_DISCONNECTED,
DATA_CONNECTIONS,
)
async def async_setup_platform(
hass, config, async_add_entities, discovery_info=None):
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the API streams platform."""
entity = APICount()
@@ -26,9 +27,11 @@ class APICount(Entity):
async def async_added_to_hass(self):
"""Added to hass."""
self.hass.helpers.dispatcher.async_dispatcher_connect(
SIGNAL_WEBSOCKET_CONNECTED, self._update_count)
SIGNAL_WEBSOCKET_CONNECTED, self._update_count
)
self.hass.helpers.dispatcher.async_dispatcher_connect(
SIGNAL_WEBSOCKET_DISCONNECTED, self._update_count)
SIGNAL_WEBSOCKET_DISCONNECTED, self._update_count
)
self._update_count()
@property