Skip to content

Commit

Permalink
Konnected: Pass hass_config to load_platform (#18027)
Browse files Browse the repository at this point in the history
  • Loading branch information
heythisisnate authored and balloob committed Nov 2, 2018
1 parent 5910161 commit 6f8ac7f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions homeassistant/components/konnected.py
Expand Up @@ -156,7 +156,7 @@ async def manual_discovery(event):

# Initialize devices specified in the configuration on boot
for device in cfg.get(CONF_DEVICES):
ConfiguredDevice(hass, device).save_data()
ConfiguredDevice(hass, device, config).save_data()

discovery.async_listen(
hass,
Expand All @@ -172,10 +172,11 @@ async def manual_discovery(event):
class ConfiguredDevice:
"""A representation of a configured Konnected device."""

def __init__(self, hass, config):
def __init__(self, hass, config, hass_config):
"""Initialize the Konnected device."""
self.hass = hass
self.config = config
self.hass_config = hass_config

@property
def device_id(self):
Expand Down Expand Up @@ -237,11 +238,11 @@ def save_data(self):
self.hass.data[DOMAIN][CONF_DEVICES][self.device_id] = device_data

discovery.load_platform(
self.hass, 'binary_sensor',
DOMAIN, {'device_id': self.device_id})
self.hass, 'binary_sensor', DOMAIN,
{'device_id': self.device_id}, self.hass_config)
discovery.load_platform(
self.hass, 'switch', DOMAIN,
{'device_id': self.device_id})
{'device_id': self.device_id}, self.hass_config)


class DiscoveredDevice:
Expand Down

0 comments on commit 6f8ac7f

Please sign in to comment.