Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Pass hass_config to load_platform is now mandatory #2

Merged
merged 1 commit into from Nov 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions visonic.py 100644 → 100755
Expand Up @@ -142,7 +142,7 @@ def add_visonic_device(visonic_devices):

# trigger discovery which will add the sensor and set up a new device
# this discovers new sensors, existing ones will remain and are not removed
discovery.load_platform(hass, "sensor", DOMAIN, {}, None)
discovery.load_platform(hass, "sensor", DOMAIN, {}, base_config)

elif type(visonic_devices) == visonicApi.SensorDevice:
# This is an update of an existing device
Expand All @@ -165,8 +165,8 @@ def disconnect_callback(excep):
_LOGGER.error(" ........... attempting reconnection")
panel_reset_counter = panel_reset_counter + 1
if connect_to_alarm():
discovery.load_platform(hass, "switch", DOMAIN)
discovery.load_platform(hass, "alarm_control_panel", DOMAIN)
discovery.load_platform(hass, "switch", DOMAIN, {}, base_config)
discovery.load_platform(hass, "alarm_control_panel", DOMAIN, {}, base_config)


def connect_to_alarm():
Expand Down Expand Up @@ -245,8 +245,8 @@ def connect_to_alarm():
if success:
# these 2 calls will create a partition "alarm control panel" and a switch that represents the panel information
# eventually there will be an "alarm control panel" for each partition but we only support 1 partition at the moment
discovery.load_platform(hass, "switch", DOMAIN)
discovery.load_platform(hass, "alarm_control_panel", DOMAIN)
discovery.load_platform(hass, "switch", DOMAIN, {}, base_config)
discovery.load_platform(hass, "alarm_control_panel", DOMAIN, {}, base_config)
return True

except (ConnectTimeout, HTTPError) as ex:
Expand Down