Skip to content
Merged

0.47 #8055

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
e39bdf8
Version bump to 0.47.0dev0
balloob Jun 2, 2017
e11ec88
Update squeezebox.py (#7617)
molobrakos Jun 2, 2017
7d4adbb
Fix html5 unsub (#7874)
balloob Jun 3, 2017
7d24efc
Added effects to Yeelight bulbs (#7152)
Mister-Espria Jun 3, 2017
6d41024
Enocean Binary Sensor: Handle click of both rockers (#7770)
twendt Jun 3, 2017
9c9f506
Support for renaming ZWave values (#7780)
emlove Jun 3, 2017
8461cf2
Fix telegram_bot (#7877)
balloob Jun 3, 2017
423e809
[light.lifx] Update aiolifx (#7882)
amelchio Jun 3, 2017
e50588a
Change nad_receiver to pypi (#7852)
joopert Jun 3, 2017
3d8b7a4
Switch pymyq to pypi (#7884)
andrey-git Jun 3, 2017
cf1a27b
Use constants (#7888)
fabaff Jun 3, 2017
1432ae6
Upgrade pyasn1-modules to 0.0.9 (#7887)
fabaff Jun 3, 2017
a745bf8
Upgrade sendgrid to 4.2.0 (#7886)
fabaff Jun 3, 2017
c07bf55
Upgrade python-telegram-bot to 6.0.3 (#7885)
fabaff Jun 3, 2017
84fe4f7
Fix MQTT camera test (#7878)
balloob Jun 4, 2017
a1c119a
Added a Taps Aff binary sensor (#7880)
Jun 4, 2017
aeb1d3d
lock.sesame: New lock platform for Sesame smart locks (#7873)
trisk Jun 5, 2017
c9d55cf
Dsmr5 revert (#7900)
aequitas Jun 5, 2017
da5f533
Fix typos in Wunderground component (Percipitation -> Precipitation) …
mje-nz Jun 5, 2017
0646d01
Add support for the expirationTime parameter. (#7895)
perosb Jun 5, 2017
6bfd52a
Etherscan.io sensor (#7855)
nkgilley Jun 5, 2017
81b1446
blockchain.info sensor (#7856)
nkgilley Jun 5, 2017
774f584
Mqtt cover modifications (#7841)
cribbstechnologies Jun 5, 2017
2e27c0d
Add Radarr sensor (#7318)
tboyce021 Jun 5, 2017
c295535
Add service to set nest away/home modes (#7619)
mattsch Jun 5, 2017
549133a
Added buienradar sensor and weather (#7592)
mjj4791 Jun 5, 2017
b90964f
Add support for Vanderbilt SPC alarm panels and attached sensors (#7663)
mbrrg Jun 5, 2017
b576df5
Update .coveragerc
balloob Jun 5, 2017
87da2ff
Add raspihats switch (#7665)
florincosta Jun 5, 2017
fa6a089
Lint
balloob Jun 5, 2017
11dcbd4
Add 'icon_template' to switch templates (similar to sensor template) …
PhracturedBlue Jun 5, 2017
12f731b
Fix docstring (#7907)
fabaff Jun 5, 2017
f8cfa15
Sync crypto-currency platforms (#7906)
fabaff Jun 5, 2017
f303f6a
Move consts to 'const.py' (#7909)
fabaff Jun 5, 2017
2b850f4
Minor cleanup - Define 'CONF_ICON_TEMPLATE' constant centrally (#7910)
PhracturedBlue Jun 5, 2017
13df925
Do not call update() in constructor (#7912)
fabaff Jun 5, 2017
aee25a0
Add juicenet platform (#7668)
Jun 5, 2017
ac85925
Bump pyEight version to fix 0hr session errors (#7916)
mezz64 Jun 5, 2017
b1f538b
update to pywebpush 1.0.4 which allows install on system with openssl…
perosb Jun 5, 2017
760138a
Do not call update() in constructor (#7917)
fabaff Jun 5, 2017
cbbb15f
Fix changes introduced with #7917 (#7930)
fabaff Jun 6, 2017
5c96936
Do not call update() in constructor (#7931)
fabaff Jun 6, 2017
5504a51
Add service_url config option to volvooncall (#7919)
mpstephana Jun 7, 2017
bb6fe82
Added 'change' field to statistics sensor (#7820)
jminn Jun 7, 2017
b87e316
add ripple sensor (#7935)
nkgilley Jun 7, 2017
d38acfb
Add Yahoo! weather platform (#7939)
fabaff Jun 7, 2017
36eb0ce
[media_player.sonos] Send media_stop on turn_off (#7940)
bjw-s Jun 7, 2017
4dbf7be
Updated dependency
danielperna84 Jun 7, 2017
7e668ef
Merge pull request #7948 from danielperna84/HomeMatic
danielperna84 Jun 7, 2017
7906105
update to 006 (#7945)
joopert Jun 8, 2017
8a4e993
Update ping.py (#7944)
vrs01 Jun 8, 2017
482db94
Add option to display all input sources / Add support for favourite c…
scarface-4711 Jun 8, 2017
97f62cf
[WIP] Fix opencv (#7864)
Teagan42 Jun 8, 2017
9bea7d7
Upgrade coinmarketcap to 3.0.1 (#7951)
fabaff Jun 8, 2017
727a22f
test connection without needing admin rights (#7947)
heinemml Jun 8, 2017
620197b
Fix the negative values bug in history_stats (#7934)
bokub Jun 8, 2017
1e352d3
Vera colored light support (#7942)
alanfischer Jun 8, 2017
0863d50
Fix typos (#7957)
fabaff Jun 8, 2017
055db05
Osram lightify, removed double set to the lightify bridge in case of …
commento Jun 8, 2017
aaaf963
Add configuration check and use default var names (#7963)
fabaff Jun 8, 2017
c52b18d
lock.sesame: Update pysesame, add state attributes (#7953)
trisk Jun 8, 2017
e4d100d
Fixed metadata issue (#7932)
Jun 9, 2017
24a1721
Create metoffice.py (#7965)
girlpunk Jun 9, 2017
a223efb
Prevent Roku doing I/O in event loop (#7969)
balloob Jun 9, 2017
4aef0b6
Merge branch 'master' into dev
balloob Jun 9, 2017
640c692
Fix platforms being able to block startup (#7970)
balloob Jun 9, 2017
db0efc6
New component: Python Script (#7950)
balloob Jun 9, 2017
49d6427
Nadtcp component (#7955)
Jun 9, 2017
a19e7ba
HomeMatic optimizations and code cleanup (#7986)
danielperna84 Jun 10, 2017
f2feabc
Update eliqonline.py (#7977)
molobrakos Jun 10, 2017
ba80d5e
test that all lights turn off when no entity id is given (#7981)
chilicheech Jun 10, 2017
b9ee5fb
make `last_name` field optional (#7988)
azogue Jun 10, 2017
1f226cf
Bugfixing with version 0.4.4 of denonavr (#7995)
scarface-4711 Jun 11, 2017
1b1619f
Upgrade py-cpuinfo to 3.3.0 (#7992)
fabaff Jun 11, 2017
9e16be3
LIFX: clean up internal color conversions (#7964)
amelchio Jun 11, 2017
314bce1
LIFX: add support for setting infrared level (#8000)
amelchio Jun 11, 2017
de0f6b7
dismiss service for persistent notifications (#7996)
tedstriker Jun 11, 2017
e7de1fb
Add Gitter.im sensor (#7998)
fabaff Jun 12, 2017
1c06b51
Fixing Client connection error (#7991)
sander76 Jun 12, 2017
401309c
Additional demo fan with only speed support (#7985)
emlove Jun 12, 2017
6e33c12
Update mailgun (#7984)
happyleavesaoc Jun 12, 2017
03f916e
Fixed bug in spotify component. (#7976)
soldag Jun 12, 2017
dc45ed3
fixing potential null issue with optional param being parsed as a scr…
cribbstechnologies Jun 12, 2017
bde711a
Make it more flexible (fixes #7954) (#8001)
fabaff Jun 12, 2017
1e1d4c2
Add Flexit AC climate platform (#7871)
Sabesto Jun 13, 2017
2bf7811
update pyripple (#8015)
nkgilley Jun 13, 2017
843f8ce
Allow put as method (#8004)
fabaff Jun 13, 2017
7fae8cd
Configure conversation for custom actions with keywords (#7734)
mjsir911 Jun 13, 2017
9189cbd
Remove globally disabled pylint issues (#8005)
fabaff Jun 13, 2017
09fec29
entity_id for service fan.turn_off is optional (#7982)
chilicheech Jun 13, 2017
1ddcab5
Make percentage string values as floats/ints in InfluxDB (#7879)
philhawthorne Jun 13, 2017
bf2fe60
Take in account Spotify account permissions (#8012)
Tommatheussen Jun 13, 2017
8c0967a
Add Dyson Pure Cool Link support (#7795)
CharlesBlonde Jun 14, 2017
02f7eb9
Allow device_tracker platforms to specify picture and icon upon disco…
andrey-git Jun 14, 2017
ae39731
Discover Z-Wave values by index (#7853)
emlove Jun 14, 2017
8eb2978
LIFX: add multiple modes to pulse effect (#8016)
amelchio Jun 15, 2017
69c9191
Do not call update() in constructor (#8048)
fabaff Jun 15, 2017
d1da536
Upgrade pysnmp to 4.3.8 (#8044)
fabaff Jun 15, 2017
deed760
Upgrade zeroconf to 0.19.1 (#8043)
fabaff Jun 15, 2017
46f3088
Vera fix for dimmable vs rgb lights (#8007)
alanfischer Jun 15, 2017
8148345
Group service / dynamic handling (#7971)
pvizeli Jun 15, 2017
92a6f21
Update frontend
balloob Jun 16, 2017
a3a702b
Adding ssocr to docker to support Seven Segments Display (#8028)
MartyTremblay Jun 16, 2017
c478f2c
Added host variable to Splunk.py and updated tox tests (#8052)
boojew Jun 16, 2017
74cc675
Restrict Python Script (#8053)
balloob Jun 16, 2017
09ca440
Fixed the Wind sensor following new release of netatmo-api-python (#8…
glpatcern Jun 16, 2017
8af6bac
media_player.firetv - Adding support for https. (#8022)
coolcow Jun 16, 2017
0eaad46
Added ONVIF camera component (#7979)
matt2005 Jun 16, 2017
a119bd0
Provide entity_id to avoid sensor mixup (fixes #7636). Use async_disp…
molobrakos Jun 16, 2017
437ddb8
Updater improvements to send option component information (#7720)
infamy Jun 16, 2017
9b640f6
Add comment to default config
balloob Jun 16, 2017
4339e9a
version bump to 0.47
balloob Jun 16, 2017
d67f3b8
Use standard entity_ids for zwave entities (#7786)
emlove Jun 16, 2017
d24b450
Update numpy 1.13.0 (#8059)
pvizeli Jun 16, 2017
d796e8d
No update in MQTT Binary Sensor #7478 (#8057)
pezinek Jun 16, 2017
3ea7dee
Always enable monkey patch (#8054)
balloob Jun 17, 2017
bf495ed
Add to zwave services descriptions (#8072)
andrey-git Jun 17, 2017
a250f58
Fix attribute entity (#8066)
pvizeli Jun 17, 2017
9fc22ee
Added 'all_plants' group and support for plant groups state. (#8063)
aronsky Jun 17, 2017
363a429
Fix EntityComponent handle entities without a name (#8065)
balloob Jun 17, 2017
a2fbc0d
Update pyunifi component to use APIError passed from pyunifi 2.13. B…
finish06 Jun 17, 2017
84aab1c
bump usps version (#8074)
happyleavesaoc Jun 17, 2017
8fffaeb
bump ups (#8075)
happyleavesaoc Jun 17, 2017
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
21 changes: 20 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ omit =
homeassistant/components/isy994.py
homeassistant/components/*/isy994.py

homeassistant/components/juicenet.py
homeassistant/components/*/juicenet.py

homeassistant/components/kira.py
homeassistant/components/*/kira.py

Expand All @@ -74,6 +77,9 @@ omit =
homeassistant/components/lutron_caseta.py
homeassistant/components/*/lutron_caseta.py

homeassistant/components/mailgun.py
homeassistant/components/*/mailgun.py

homeassistant/components/modbus.py
homeassistant/components/*/modbus.py

Expand Down Expand Up @@ -197,15 +203,18 @@ omit =
homeassistant/components/binary_sensor/pilight.py
homeassistant/components/binary_sensor/ping.py
homeassistant/components/binary_sensor/rest.py
homeassistant/components/binary_sensor/tapsaff.py
homeassistant/components/browser.py
homeassistant/components/camera/amcrest.py
homeassistant/components/camera/bloomsky.py
homeassistant/components/camera/ffmpeg.py
homeassistant/components/camera/foscam.py
homeassistant/components/camera/mjpeg.py
homeassistant/components/camera/rpi_camera.py
homeassistant/components/camera/onvif.py
homeassistant/components/camera/synology.py
homeassistant/components/climate/eq3btsmart.py
homeassistant/components/climate/flexit.py
homeassistant/components/climate/heatmiser.py
homeassistant/components/climate/homematic.py
homeassistant/components/climate/knx.py
Expand Down Expand Up @@ -286,6 +295,7 @@ omit =
homeassistant/components/lirc.py
homeassistant/components/lock/nuki.py
homeassistant/components/lock/lockitron.py
homeassistant/components/lock/sesame.py
homeassistant/components/media_player/anthemav.py
homeassistant/components/media_player/apple_tv.py
homeassistant/components/media_player/aquostv.py
Expand All @@ -310,6 +320,7 @@ omit =
homeassistant/components/media_player/mpchc.py
homeassistant/components/media_player/mpd.py
homeassistant/components/media_player/nad.py
homeassistant/components/media_player/nadtcp.py
homeassistant/components/media_player/onkyo.py
homeassistant/components/media_player/openhome.py
homeassistant/components/media_player/panasonic_viera.py
Expand Down Expand Up @@ -341,7 +352,6 @@ omit =
homeassistant/components/notify/kodi.py
homeassistant/components/notify/lannouncer.py
homeassistant/components/notify/llamalab_automate.py
homeassistant/components/notify/mailgun.py
homeassistant/components/notify/matrix.py
homeassistant/components/notify/message_bird.py
homeassistant/components/notify/nfandroidtv.py
Expand Down Expand Up @@ -370,8 +380,10 @@ omit =
homeassistant/components/sensor/arwn.py
homeassistant/components/sensor/bbox.py
homeassistant/components/sensor/bitcoin.py
homeassistant/components/sensor/blockchain.py
homeassistant/components/sensor/bom.py
homeassistant/components/sensor/broadlink.py
homeassistant/components/sensor/buienradar.py
homeassistant/components/sensor/dublin_bus_transport.py
homeassistant/components/sensor/coinmarketcap.py
homeassistant/components/sensor/cert_expiry.py
Expand All @@ -391,13 +403,15 @@ omit =
homeassistant/components/sensor/eliqonline.py
homeassistant/components/sensor/emoncms.py
homeassistant/components/sensor/envirophat.py
homeassistant/components/sensor/etherscan.py
homeassistant/components/sensor/fastdotcom.py
homeassistant/components/sensor/fedex.py
homeassistant/components/sensor/fido.py
homeassistant/components/sensor/fitbit.py
homeassistant/components/sensor/fixer.py
homeassistant/components/sensor/fritzbox_callmonitor.py
homeassistant/components/sensor/fritzbox_netmonitor.py
homeassistant/components/sensor/gitter.py
homeassistant/components/sensor/glances.py
homeassistant/components/sensor/google_travel_time.py
homeassistant/components/sensor/gpsd.py
Expand Down Expand Up @@ -435,6 +449,8 @@ omit =
homeassistant/components/sensor/pushbullet.py
homeassistant/components/sensor/pvoutput.py
homeassistant/components/sensor/qnap.py
homeassistant/components/sensor/radarr.py
homeassistant/components/sensor/ripple.py
homeassistant/components/sensor/sabnzbd.py
homeassistant/components/sensor/scrape.py
homeassistant/components/sensor/sensehat.py
Expand Down Expand Up @@ -464,6 +480,7 @@ omit =
homeassistant/components/sensor/xbox_live.py
homeassistant/components/sensor/yweather.py
homeassistant/components/sensor/zamg.py
homeassistant/components/spc.py
homeassistant/components/switch/acer_projector.py
homeassistant/components/switch/anel_pwrctrl.py
homeassistant/components/switch/arest.py
Expand Down Expand Up @@ -492,8 +509,10 @@ omit =
homeassistant/components/tts/picotts.py
homeassistant/components/upnp.py
homeassistant/components/weather/bom.py
homeassistant/components/weather/buienradar.py
homeassistant/components/weather/metoffice.py
homeassistant/components/weather/openweathermap.py
homeassistant/components/weather/yweather.py
homeassistant/components/weather/zamg.py
homeassistant/components/zeroconf.py
homeassistant/components/zwave/util.py
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ MAINTAINER Paulus Schoutsen <Paulus@PaulusSchoutsen.nl>
#ENV INSTALL_LIBCEC no
#ENV INSTALL_PHANTOMJS no
#ENV INSTALL_COAP_CLIENT no
#ENV INSTALL_SSOCR no

VOLUME /config

Expand Down
61 changes: 7 additions & 54 deletions homeassistant/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,50 +31,8 @@ def attempt_use_uvloop():
pass


def monkey_patch_asyncio():
"""Replace weakref.WeakSet to address Python 3 bug.

Under heavy threading operations that schedule calls into
the asyncio event loop, Task objects are created. Due to
a bug in Python, GC may have an issue when switching between
the threads and objects with __del__ (which various components
in HASS have).

This monkey-patch removes the weakref.Weakset, and replaces it
with an object that ignores the only call utilizing it (the
Task.__init__ which calls _all_tasks.add(self)). It also removes
the __del__ which could trigger the future objects __del__ at
unpredictable times.

The side-effect of this manipulation of the Task is that
Task.all_tasks() is no longer accurate, and there will be no
warning emitted if a Task is GC'd while in use.

On Python 3.6, after the bug is fixed, this monkey-patch can be
disabled.

See https://bugs.python.org/issue26617 for details of the Python
bug.
"""
# pylint: disable=no-self-use, protected-access, bare-except
import asyncio.tasks

class IgnoreCalls:
"""Ignore add calls."""

def add(self, other):
"""No-op add."""
return

asyncio.tasks.Task._all_tasks = IgnoreCalls()
try:
del asyncio.tasks.Task.__del__
except:
pass


def validate_python() -> None:
"""Validate we're running the right Python version."""
"""Validate that the right Python version is running."""
if sys.platform == "win32" and \
sys.version_info[:3] < REQUIRED_PYTHON_VER_WIN:
print("Home Assistant requires at least Python {}.{}.{}".format(
Expand Down Expand Up @@ -215,7 +173,7 @@ def daemonize() -> None:


def check_pid(pid_file: str) -> None:
"""Check that HA is not already running."""
"""Check that Home Assistant is not already running."""
# Check pid file
try:
pid = int(open(pid_file, 'r').readline())
Expand Down Expand Up @@ -329,7 +287,7 @@ def open_browser(event):


def try_to_restart() -> None:
"""Attempt to clean up state and start a new homeassistant instance."""
"""Attempt to clean up state and start a new Home Assistant instance."""
# Things should be mostly shut down already at this point, now just try
# to clean up things that may have been left behind.
sys.stderr.write('Home Assistant attempting to restart.\n')
Expand Down Expand Up @@ -361,11 +319,11 @@ def try_to_restart() -> None:
else:
os.closerange(3, max_fd)

# Now launch into a new instance of Home-Assistant. If this fails we
# Now launch into a new instance of Home Assistant. If this fails we
# fall through and exit with error 100 (RESTART_EXIT_CODE) in which case
# systemd will restart us when RestartForceExitStatus=100 is set in the
# systemd.service file.
sys.stderr.write("Restarting Home-Assistant\n")
sys.stderr.write("Restarting Home Assistant\n")
args = cmdline()
os.execv(args[0], args)

Expand All @@ -374,18 +332,13 @@ def main() -> int:
"""Start Home Assistant."""
validate_python()

if os.environ.get('HASS_MONKEYPATCH_ASYNCIO') == '1':
if sys.version_info[:3] >= (3, 6):
if os.environ.get('HASS_NO_MONKEY') != '1':
if sys.version_info[:2] >= (3, 6):
monkey_patch.disable_c_asyncio()
monkey_patch.patch_weakref_tasks()
elif sys.version_info[:3] < (3, 5, 3):
monkey_patch.patch_weakref_tasks()

attempt_use_uvloop()

if sys.version_info[:3] < (3, 5, 3):
monkey_patch_asyncio()

args = get_arguments()

if args.script is not None:
Expand Down
96 changes: 96 additions & 0 deletions homeassistant/components/alarm_control_panel/spc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
"""
Support for Vanderbilt (formerly Siemens) SPC alarm systems.

For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.spc/
"""
import asyncio
import logging

import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.spc import (
SpcWebGateway, ATTR_DISCOVER_AREAS, DATA_API, DATA_REGISTRY)
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
STATE_UNKNOWN)


_LOGGER = logging.getLogger(__name__)

SPC_AREA_MODE_TO_STATE = {'0': STATE_ALARM_DISARMED,
'1': STATE_ALARM_ARMED_HOME,
'3': STATE_ALARM_ARMED_AWAY}


def _get_alarm_state(spc_mode):
return SPC_AREA_MODE_TO_STATE.get(spc_mode, STATE_UNKNOWN)


@asyncio.coroutine
def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
"""Set up the SPC alarm control panel platform."""
if (discovery_info is None or
discovery_info[ATTR_DISCOVER_AREAS] is None):
return

entities = [SpcAlarm(hass=hass,
area_id=area['id'],
name=area['name'],
state=_get_alarm_state(area['mode']))
for area in discovery_info[ATTR_DISCOVER_AREAS]]

async_add_entities(entities)


class SpcAlarm(alarm.AlarmControlPanel):
"""Represents the SPC alarm panel."""

def __init__(self, hass, area_id, name, state):
"""Initialize the SPC alarm panel."""
self._hass = hass
self._area_id = area_id
self._name = name
self._state = state
self._api = hass.data[DATA_API]

hass.data[DATA_REGISTRY].register_alarm_device(area_id, self)

@asyncio.coroutine
def async_update_from_spc(self, state):
"""Update the alarm panel with a new state."""
self._state = state
yield from self.async_update_ha_state()

@property
def should_poll(self):
"""No polling needed."""
return False

@property
def name(self):
"""Return the name of the device."""
return self._name

@property
def state(self):
"""Return the state of the device."""
return self._state

@asyncio.coroutine
def async_alarm_disarm(self, code=None):
"""Send disarm command."""
yield from self._api.send_area_command(
self._area_id, SpcWebGateway.AREA_COMMAND_UNSET)

@asyncio.coroutine
def async_alarm_arm_home(self, code=None):
"""Send arm home command."""
yield from self._api.send_area_command(
self._area_id, SpcWebGateway.AREA_COMMAND_PART_SET)

@asyncio.coroutine
def async_alarm_arm_away(self, code=None):
"""Send arm away command."""
yield from self._api.send_area_command(
self._area_id, SpcWebGateway.AREA_COMMAND_SET)
1 change: 1 addition & 0 deletions homeassistant/components/automation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from homeassistant.components.frontend import register_built_in_panel

DOMAIN = 'automation'
DEPENDENCIES = ['group']
ENTITY_ID_FORMAT = DOMAIN + '.{}'

GROUP_NAME_ALL_AUTOMATIONS = 'all automations'
Expand Down
6 changes: 6 additions & 0 deletions homeassistant/components/binary_sensor/enocean.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ def value_changed(self, value, value2):
elif value2 == 0x10:
self.which = 1
self.onoff = 1
elif value2 == 0x37:
self.which = 10
self.onoff = 0
elif value2 == 0x15:
self.which = 10
self.onoff = 1
self.hass.bus.fire('button_pressed', {'id': self.dev_id,
'pushed': value,
'which': self.which,
Expand Down
16 changes: 7 additions & 9 deletions homeassistant/components/binary_sensor/homematic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Support for Homematic binary sensors.
Support for HomeMatic binary sensors.

For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.homematic/
Expand Down Expand Up @@ -29,7 +29,7 @@


def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the Homematic binary sensor platform."""
"""Set up the HomeMatic binary sensor platform."""
if discovery_info is None:
return

Expand All @@ -43,7 +43,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):


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

@property
def is_on(self):
Expand All @@ -54,16 +54,14 @@ def is_on(self):

@property
def device_class(self):
"""Return the class of this sensor, from DEVICE_CLASSES."""
# If state is MOTION (RemoteMotion works only)
"""Return the class of this sensor from DEVICE_CLASSES."""
# If state is MOTION (Only RemoteMotion working)
if self._state == 'MOTION':
return 'motion'
return SENSOR_TYPES_CLASS.get(self._hmdevice.__class__.__name__, None)

def _init_data_struct(self):
"""Generate a data struct (self._data) from the Homematic metadata."""
# add state to data struct
"""Generate the data dictionary (self._data) from metadata."""
# Add state to data struct
if self._state:
_LOGGER.debug("%s init datastruct with main node '%s'", self._name,
self._state)
self._data.update({self._state: STATE_UNKNOWN})
Loading