Support for multiple Fibaro gateways (#19705)

* Preparing for transition to config flow

Added multiple gateway support
Reworked parameter flow to platforms to enable multiple controllers
Breaking change to config, now a list of gateways is expected instead of a single config

* Updated coveragerc

Added new location of fibaro component

* Fixes based on code review and extended logging

Addressed issues raised by code review
Added extended debug logging to get better reports from users if the device type mapping is not perfect

* Changhes based on code review

Changes to how configuration is read and schemas
Fix to device type mapping logic

* simplified reading config

* oops

oops

* grr

grr

* change based on code review

* changes based on code review

changes based on code review
This commit is contained in:
pbalogh77 authored and Paulus Schoutsen committed 2019-01-11 15:29:54 -08:00
1 parent d820efc4e3
commit 7dac7b9e5e
8 files changed
+78 -58

No files matched your search

+4 -4
View File
@@ -12,7 +12,7 @@ from functools import partial
from homeassistant.const import (
CONF_WHITE_VALUE)
from homeassistant.components.fibaro import (
FIBARO_CONTROLLER, FIBARO_DEVICES, FibaroDevice,
FIBARO_DEVICES, FibaroDevice,
CONF_DIMMING, CONF_COLOR, CONF_RESET_COLOR)
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_HS_COLOR, ATTR_WHITE_VALUE, ENTITY_ID_FORMAT,
@@ -50,14 +50,14 @@ async def async_setup_platform(hass,
return
async_add_entities(
[FibaroLight(device, hass.data[FIBARO_CONTROLLER])
[FibaroLight(device)
for device in hass.data[FIBARO_DEVICES]['light']], True)
class FibaroLight(FibaroDevice, Light):
"""Representation of a Fibaro Light, including dimmable."""
def __init__(self, fibaro_device, controller):
def __init__(self, fibaro_device):
"""Initialize the light."""
self._brightness = None
self._color = (0, 0)
@@ -81,7 +81,7 @@ class FibaroLight(FibaroDevice, Light):
if devconf.get(CONF_WHITE_VALUE, supports_white_v):
self._supported_flags |= SUPPORT_WHITE_VALUE
super().__init__(fibaro_device, controller)
super().__init__(fibaro_device)
self.entity_id = ENTITY_ID_FORMAT.format(self.ha_id)
@property