Implementation of a KNX platform driver and a KNX switch (#2439)
* Implementation of a KNX platform driver and a KNX switch * Starting working on a KNX thermostat implementation * Removed KNX thermostat implementation from this branch again * Make gateway parameter optional (can be auto-detected in many cases) * Removed check for double initialisation * KNX messages now will be handled internally and not send to the Home Assistant message bus * Call update_ha_state only if should_poll is false * Removed unused HASS variable * knxip library version changed * pylint optimization
This commit is contained in:
parent
bde9e4e9c0
commit
50ea3c7744
5 changed files with 372 additions and 0 deletions
24
homeassistant/components/binary_sensor/knx.py
Normal file
24
homeassistant/components/binary_sensor/knx.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
"""
|
||||
Contains functionality to use a KNX group address as a binary.
|
||||
|
||||
For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/switch.knx/
|
||||
"""
|
||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||
from homeassistant.components.knx import (
|
||||
KNXConfig, KNXGroupAddress)
|
||||
|
||||
DEPENDENCIES = ["knx"]
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"""Create and add an entity based on the configuration."""
|
||||
add_entities([
|
||||
KNXSwitch(hass, KNXConfig(config))
|
||||
])
|
||||
|
||||
|
||||
class KNXSwitch(KNXGroupAddress, BinarySensorDevice):
|
||||
"""Representation of a KNX sensor device."""
|
||||
|
||||
pass
|
Loading…
Add table
Add a link
Reference in a new issue