commit
a57cd58675
|
@ -92,7 +92,6 @@ def setup(hass, config):
|
||||||
|
|
||||||
# Create server thread
|
# Create server thread
|
||||||
bound_system_callback = partial(system_callback_handler, hass, config)
|
bound_system_callback = partial(system_callback_handler, hass, config)
|
||||||
# pylint: disable=unexpected-keyword-arg
|
|
||||||
HOMEMATIC = HMConnection(local=local_ip,
|
HOMEMATIC = HMConnection(local=local_ip,
|
||||||
localport=local_port,
|
localport=local_port,
|
||||||
remote=remote_ip,
|
remote=remote_ip,
|
||||||
|
@ -288,15 +287,19 @@ def setup_hmdevice_discovery_helper(hmdevicetype, discovery_info,
|
||||||
|
|
||||||
def _hm_event_handler(hass, device, caller, attribute, value):
|
def _hm_event_handler(hass, device, caller, attribute, value):
|
||||||
"""Handle all pyhomematic device events."""
|
"""Handle all pyhomematic device events."""
|
||||||
channel = device.split(":")[1]
|
try:
|
||||||
address = device.split(":")[0]
|
channel = int(device.split(":")[1])
|
||||||
hmdevice = HOMEMATIC.devices.get(address)
|
address = device.split(":")[0]
|
||||||
|
hmdevice = HOMEMATIC.devices.get(address)
|
||||||
|
except (TypeError, ValueError):
|
||||||
|
_LOGGER.error("Event handling channel convert error!")
|
||||||
|
return
|
||||||
|
|
||||||
# is not a event?
|
# is not a event?
|
||||||
if attribute not in hmdevice.EVENTNODE:
|
if attribute not in hmdevice.EVENTNODE:
|
||||||
return
|
return
|
||||||
|
|
||||||
_LOGGER.debug("Event %s for %s channel %s", attribute,
|
_LOGGER.debug("Event %s for %s channel %i", attribute,
|
||||||
hmdevice.NAME, channel)
|
hmdevice.NAME, channel)
|
||||||
|
|
||||||
# a keypress event
|
# a keypress event
|
||||||
|
|
|
@ -17,7 +17,8 @@ _LOGGER = logging.getLogger(__name__)
|
||||||
DEPENDENCIES = ['homematic']
|
DEPENDENCIES = ['homematic']
|
||||||
|
|
||||||
HM_STATE_HA_CAST = {
|
HM_STATE_HA_CAST = {
|
||||||
"RotaryHandleSensor": {0: "closed", 1: "tilted", 2: "open"}
|
"RotaryHandleSensor": {0: "closed", 1: "tilted", 2: "open"},
|
||||||
|
"WaterSensor": {0: "dry", 1: "wet", 2: "water"}
|
||||||
}
|
}
|
||||||
|
|
||||||
HM_UNIT_HA_CAST = {
|
HM_UNIT_HA_CAST = {
|
||||||
|
|
Loading…
Reference in New Issue