Add experimental camera support

This commit is contained in:
2019-09-25 08:30:54 +02:00
parent a96667fb86
commit f13ac064ca
9 changed files with 336 additions and 64 deletions

View File

@@ -2,7 +2,7 @@ import logging
from homeassistant.helpers.entity import Entity, async_generate_entity_id
from .const import DOMAIN, DATA_DEVICES, DATA_ALIASES, DATA_ADDERS, CONFIG_DEVICES
from .const import DOMAIN, DATA_DEVICES, DATA_ALIASES, DATA_ADDERS, CONFIG_DEVICES, DATA_CONFIG
_LOGGER = logging.getLogger(__name__)
@@ -15,6 +15,10 @@ def get_alias(hass, deviceID):
return k
return None
def get_config(hass, deviceID):
config = hass.data[DOMAIN][DATA_CONFIG]
return config.get(deviceID, config.get(deviceID.replace('-','_'), {}))
def create_entity(hass, platform, deviceID, connection):
adder = hass.data[DOMAIN][DATA_ADDERS][platform]
entity = adder(hass, deviceID, connection, get_alias(hass, deviceID))