Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions homeassistant/components/switch/rpi_rf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

import voluptuous as vol

from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.const import (CONF_NAME, CONF_SWITCHES)
from homeassistant.components.switch import SwitchDevice, PLATFORM_SCHEMA
from homeassistant.const import (
CONF_NAME, CONF_SWITCHES, EVENT_HOMEASSISTANT_STOP)
import homeassistant.helpers.config_validation as cv

REQUIREMENTS = ['rpi-rf==0.9.6']
Expand Down Expand Up @@ -71,6 +72,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None):

add_devices(devices)

hass.bus.listen_once(
EVENT_HOMEASSISTANT_STOP, lambda event: rfdevice.cleanup())


class RPiRFSwitch(SwitchDevice):
"""Representation of a GPIO RF switch."""
Expand Down