Skip to content

Commit

Permalink
Homematic update with HomematicIP/HomematicWired support and multible… (
Browse files Browse the repository at this point in the history
home-assistant#4568)

* Homematic update with HomematicIP/HomematicWired support and multible connections

* fix bug in virtualkey service

* create new service & cleanups

* fix lint

* Pump pyhomematic 0.1.18
  • Loading branch information
pvizeli authored Nov 29, 2016
1 parent 2d02baf commit 17f0fb6
Show file tree
Hide file tree
Showing 9 changed files with 360 additions and 187 deletions.
7 changes: 5 additions & 2 deletions homeassistant/components/binary_sensor/homematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import logging
from homeassistant.const import STATE_UNKNOWN
from homeassistant.components.binary_sensor import BinarySensorDevice
import homeassistant.components.homematic as homematic
from homeassistant.components.homematic import HMDevice
from homeassistant.loader import get_component

_LOGGER = logging.getLogger(__name__)

Expand All @@ -32,14 +33,16 @@ def setup_platform(hass, config, add_callback_devices, discovery_info=None):
if discovery_info is None:
return

homematic = get_component("homematic")
return homematic.setup_hmdevice_discovery_helper(
hass,
HMBinarySensor,
discovery_info,
add_callback_devices
)


class HMBinarySensor(homematic.HMDevice, BinarySensorDevice):
class HMBinarySensor(HMDevice, BinarySensorDevice):
"""Representation of a binary Homematic device."""

@property
Expand Down
7 changes: 5 additions & 2 deletions homeassistant/components/climate/homematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
https://home-assistant.io/components/climate.homematic/
"""
import logging
import homeassistant.components.homematic as homematic
from homeassistant.components.climate import ClimateDevice, STATE_AUTO
from homeassistant.components.homematic import HMDevice
from homeassistant.util.temperature import convert
from homeassistant.const import TEMP_CELSIUS, STATE_UNKNOWN, ATTR_TEMPERATURE
from homeassistant.loader import get_component

DEPENDENCIES = ['homematic']

Expand All @@ -29,14 +30,16 @@ def setup_platform(hass, config, add_callback_devices, discovery_info=None):
if discovery_info is None:
return

homematic = get_component("homematic")
return homematic.setup_hmdevice_discovery_helper(
hass,
HMThermostat,
discovery_info,
add_callback_devices
)


class HMThermostat(homematic.HMDevice, ClimateDevice):
class HMThermostat(HMDevice, ClimateDevice):
"""Representation of a Homematic thermostat."""

@property
Expand Down
7 changes: 5 additions & 2 deletions homeassistant/components/cover/homematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
from homeassistant.const import STATE_UNKNOWN
from homeassistant.components.cover import CoverDevice,\
ATTR_POSITION
import homeassistant.components.homematic as homematic
from homeassistant.components.homematic import HMDevice
from homeassistant.loader import get_component

_LOGGER = logging.getLogger(__name__)

Expand All @@ -24,14 +25,16 @@ def setup_platform(hass, config, add_callback_devices, discovery_info=None):
if discovery_info is None:
return

homematic = get_component("homematic")
return homematic.setup_hmdevice_discovery_helper(
hass,
HMCover,
discovery_info,
add_callback_devices
)


class HMCover(homematic.HMDevice, CoverDevice):
class HMCover(HMDevice, CoverDevice):
"""Represents a Homematic Cover in Home Assistant."""

@property
Expand Down
Loading

0 comments on commit 17f0fb6

Please sign in to comment.