Commit Graph

283 Commits (dcaced19663ae0dedc0f4a017ebc327e264c4ee8)

Author SHA1 Message Date
huangyupeng 539b86e079 Add Tuya cover state (#16709)
* add cover open and close state

* add tuya cover state

* fix pylint

* fix pylint problem
2018-09-23 10:36:33 +02:00
Robert Svensson 7fe0d8b2f4
deCONZ cover support (#16759)
deCONZ cover platform for Keen vents
2018-09-21 19:59:20 +02:00
geekofweek 60dfd68083 MyQ Open State Fix (#16681)
* MyQ Open State Fix

Fixes issues with MyQ reporting an open state

* Update myq.py

* MyQ STATE_OPEN Fix

remove un-needed code
2018-09-19 22:03:47 +02:00
Ville Skyttä 227a1b919b More isort preparations (#16633)
* Adjust config closer to currently established style conventions

* Adjust some imports for better outcome with their comments
2018-09-19 15:40:36 +02:00
Toon Willems 3bd12fcef6 Implement correct state for RFlink cover (#16304)
* implement correct state for rflink cover

* Fix linting error

* invert logic as local testing pointed out it should be reversed

* add period at the end to satisfy the linter
2018-09-04 11:15:02 +02:00
Tom Harris d3791fa45d Add Cover to the Insteon component (#16215)
* Create cover platform

* Create insteon cover platform

* Bump insteonplm to 0.13.0

* Change async_add_devices to async_add_entities

* Missing doc string

* Simplify open and set_position

* Flake8

* Bump insteonplm to 0.13.1

* Code review changes

* Flake8 updates
2018-08-31 23:56:26 +02:00
Matt Schmitt fa81385b5c Add unique ID (#16323) 2018-08-31 16:47:37 +02:00
Matt Schmitt aaa1ebeed5 Add support for discrete states to MyQ cover (#16251)
* Add discrete states and update dependency

* Add translation dict
2018-08-29 14:33:09 +02:00
Robert Svensson 5341785aae Revert changes to platforms using self.device (#16209)
* Revert tank_utility

* Fix Soundtouch

* Fix Plex

* Fix Emby

* Fix Radiotherm

* Fix Juicenet

* Fix Qwikswitch

* Fix Xiaomi miio

* Fix Nest

* Fix Tellduslive

* Fix KNX
2018-08-26 21:25:39 +02:00
Paulus Schoutsen 994b829cb4
add_devices -> add_entities (#16171)
* add_devices -> add_entities

* Lint

* PyLint

* Revert external method in scsgate
2018-08-24 16:37:30 +02:00
Eduard van Valkenburg 4ad76d8916 Upgrade brunt package (#16130)
* Bumped package version to fix a bug with Python before 3.6

* update of package version in requirements_all
2018-08-22 20:12:54 +02:00
Robert Svensson 0009be595c Device Registry (#15980)
* First draft

* Generate device id

* No obscure registry

* Dont store config_entry_id in device

* Storage

* Small mistake on rebase

* Do storage more like entity registry

* Improve device identification

* Add tests

* Remove deconz device support from PR

* Fix hound comments, voff!

* Fix comments and clean up

* Fix proper indentation

* Fix pydoc issues

* Fix mochad component to not use self.device

* Fix mochad light platform to not use self.device

* Fix TankUtilitySensor to not use self.device

* Fix Soundtouch to not use self.device

* Fix Plex to not use self.device

* Fix Emby to not use self.device

* Fix Heatmiser to not use self.device

* Fix Wemo lights to not use self.device

* Fix Lifx to not use self.device

* Fix Radiotherm to not use self.device

* Fix Juicenet to not use self.device

* Fix Qwikswitch to not use self.device

* Fix Xiaomi miio to not use self.device

* Fix Nest to not use self.device

* Fix Tellduslive to not use self.device

* Fix Knx to not use self.device

* Clean up a small mistake in soundtouch

* Fix comment from Ballob

* Fix bad indentation

* Fix indentatin

* Lint

* Remove unused variable

* Lint
2018-08-22 10:46:37 +02:00
Fabian Affolter 0e1fb74e1b
Minor updates (#16106) 2018-08-21 21:25:16 +02:00
Paulus Schoutsen b682e48e12
Entity service (#15991)
* Add entity service helper

* Use entity service helper

* Context
2018-08-16 09:50:11 +02:00
Josh Shoemaker e52ba87af1 Upgrade aladdin_connect to 0.3 and provide Unique ID (#15986)
* Upgrade aladdin_connect to 0.2 and set unique_id

* update code to be Python 3.5 compatible
2018-08-16 07:18:29 +02:00
fucm 5e1836f3a2 Add support for 2 Tahoma IO awning covers (#15660)
* Add Tahoma io:VerticalExteriorAwningIOComponent and io:HorizontalAwningIOComponent

* Fix position of horizontal awning cover

* Add timestamps for lock time

* Adjust open-close actions for horizontal awning cover

* Fix stop action for io:RollerShutterGenericIOComponent

* Remove redundant information

* Use get for dict lookup
2018-08-05 10:44:57 +02:00
Josh Shoemaker 8dbe78a21a Add Genie Aladdin Connect cover component (#15699)
* Add Genie Aladdin Connect cover component

* Fix lines being too long

* Fix issues found in review

* remove Unknown state, use None instead

* Fixed requirements_all
2018-07-30 07:19:34 +02:00
Eduard van Valkenburg 95dc06cca6 Add Brunt Cover Device (#15653)
* New Brunt Branch

* Some small changes and updates based on review.
2018-07-25 12:17:12 +02:00
huangyupeng c1f5ead61d Add Tuya cover and scene platform (#15587)
* Add Tuya cover platform

* Add Tuya cover and scene

* fix description

* remove scene default method
2018-07-24 10:29:43 +02:00
Ville Skyttä b7c336a687 Pylint cleanups (#15626)
* Pylint 2 no-else-return fixes

* Remove unneeded abstract-class-not-used pylint disable
2018-07-23 10:16:05 +02:00
Ville Skyttä 2f7b79764a More pylint 2 fixes (#15565)
## Description:

More fixes flagged by pylint 2 that don't hurt to have before the actual pylint 2 upgrade (which I'll submit soon).

## Checklist:
  - [ ] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
2018-07-20 11:45:20 +03:00
Ville Skyttä bf17ed0917 More pylint 2 fixes (#15516)
* Pylint 2 useless-import-alias fixes

* Pylint 2 chained-comparison fixes

* Pylint 2 consider-using-get fixes

* Pylint 2 len-as-condition fixes
2018-07-18 11:54:27 +02:00
Ville Skyttä 37ccf87516 Remove unnecessary executable permissions (#15469) 2018-07-14 23:03:36 +02:00
pepeEL cd1cfd7e8e New device to support option MY in somfy (#15272)
New device to support option MY in somfy
2018-07-03 08:39:42 +02:00
cdce8p 3da4642194
Use async syntax for cover platforms (#15230) 2018-06-30 18:10:59 +02:00
Ville Skyttä b92350fb55 Lint cleanup (#15103)
* Remove unneeded inline pylint disables

* Remove unneeded noqa's

* Use symbol names instead of message ids in inline pylint disables
2018-06-25 13:05:07 -04:00
Martin Hjelmare 3893d8a876 Reorganize mysensors (#15123)
* Move mysensors.py to package

* Move mysensors component to package

* Split code into multiple modules.

* Update coveragerc
2018-06-25 13:58:16 +02:00
William Scanlon 6bc03ee763 Python wink update (#15048)
* Updated python-wink to 1.9.0

* Added support for groups of Wink shades.
2018-06-20 09:41:28 -04:00
Ville Skyttä 4bd7a7eee3 Remove inline pylint disables for messages disabled in pylintrc (#14978) 2018-06-16 00:15:46 +02:00
ArrayLabs fecce206a9 Myq update from 0.0.8 to 0.0.11 (#14947)
* Update requirements_all.txt

Update myq from 0.0.8 to 0.0.11

* Update myq.py

Update myq from 0.0.8 to 0.0.11
2018-06-13 08:02:27 +02:00
Paulus Schoutsen 90a51160c4
Don't run unnecessary methods in executor pool (#14853)
* Don't run unnecessary methods in executor pool

* Lint

* Lint 2
2018-06-07 15:31:21 -04:00
Otto Winter fcb60d472e MQTT Cover Fix Assumed State (#14672) 2018-05-29 09:03:45 -04:00
guillaume1410 c425afe50e Adding ryobi garage door opener (#14618)
* Initial component for Ryobi cover

* Initial component for Ryobi cover

* Adding Ryobi cover

* Adding Ryobi cover

* Adding Ryobi cover

* Minor changes

* Remove import
2018-05-26 22:46:53 +02:00
Aaron Bach 5205354cb7 Adds a device class of 'garage' to MyQ covers (#14602) 2018-05-24 07:58:35 +02:00
Martin Hjelmare be3b227a87
Make mysensors component async (#13641)
* Make mysensors component async

* Use async dispatcher and discovery.
* Run I/O in executor.
* Make mysensors actuator methods async.
* Upgrade pymysensors to 0.13.0.
* Use async serial gateway.
* Use async TCP gateway.
* Use async mqtt gateway.

* Start gateway before hass start event

* Make sure gateway is started after discovery of persistent devices
  and after corresponding platforms have been loaded.
* Don't wait to start gateway until after hass start.

* Bump pymysensors to 0.14.0
2018-05-11 09:39:18 +02:00
David Broadfoot eb551a6d5a Gogogate2 0.1.1 (#14294)
* Gogogate2 - bump version

Uses latest version of library which ensures commands to device are idempotent

* Update requirements_all

* Expose sensor temperature

* update version

* import attribute

* Set temperature

* Remove temperature attribute

Removed temperature attribute until it can be re-implemented as a separate sensor.

* Update ordering

* Fix copy-&-paste issue
2018-05-08 11:42:18 -04:00
m4dmin 4343659742 add 2 devices (#14321)
* add 2 devices

io:RollerShutterUnoIOComponent
io:ExteriorVenetianBlindIOComponent

* add 2 devices

* Update tahoma.py

* Fix hounci-bot violation

* Fixed Travis CI build failure

./homeassistant/components/cover/tahoma.py:83:13: E125 continuation line with same indent as next logical line

* Fixed Travis CI build failure

E125 continuation line with same indent as next logical line

* Fixed Travis CI build failure

E127 continuation line over-indented for visual indent

* Fix indent

* Change check
2018-05-08 13:43:07 +02:00
Thijs de Jong 558b659f7c Add devices to Tahoma (#14075) 2018-04-25 07:09:45 +02:00
David Broadfoot 86374ad809 bump gogogate2 version (#14044)
* bump gogogate2 version

* Update - requirements_all
2018-04-22 12:54:48 +02:00
David Broadfoot 58f3690ef6 Fix Gogogate2 'available' attribute (#13728)
* Fixed bug -  unable to set base readaonly property

* PR fixes

* Added line
2018-04-07 05:48:53 +02:00
Fabian Affolter 3394916a68
Update docstrings (#13720) 2018-04-06 18:06:47 +02:00
David Broadfoot bd51143ac1 Added gogogate2 cover (#13467)
* Added gogogate2 cover

* Hound fixes

* PR feedback

* Hound comments

* Bump gogogate2 version

* Update requirements all

* Add device_class and features

* Fix lint issues

* Again lint

* Fix imports

* Fix end of file
2018-04-06 15:53:00 +02:00
Chris Jones dee47d50ec Use 0/1 for raspberry pi cover GPIO writes rather than true/false (#13610)
* Use 0/1 for GPIO writes rather than true/false

GPIO pins don't appear to respond to true/false writes, and this is reflected in code elsewhere. For example, in `\components\switch\rpio_gpio.py` the following code is used:

```
    def turn_on(self, **kwargs):
        """Turn the device on."""
        rpi_gpio.write_output(self._port, 0 if self._invert_logic else 1)
        self._state = True
        self.schedule_update_ha_state()
```

This code works. Hence this PR uses 0/1 in the raspberry pi GPIO cover, instead of true/false.

* Update rpi_gpio.py
2018-04-01 08:37:03 -07:00
Martin Hjelmare c8f2810fac Make mysensors updates and platform setup async (#13603)
* Use async updates but keep methods that interact with mysensors
  gateway thread, eg turn_on and turn_off, non async.
* Use Python 3.5 async syntax.
2018-04-01 08:36:26 -07:00
Tod Schmidt bf44dc422c Added HassOpenCover and HassCloseCover intents (#13372)
* Added intents to cover

* Added test for cover intents

* Style fixes

* Reverted reversions

* Async fixes

* Woof

* Added conditional loading

* Added conditional loading

* Added conditional loading

* Moved tests, fixed logic

* Moved tests, fixed logic

* Pylint

* Pylint

* Refactored componenet registration

* Refactored componenet registration

* Lint
2018-03-30 17:22:48 -07:00
cdce8p 7fd687f59c Fix current_cover_position (#13135) 2018-03-23 13:54:19 -07:00
cdce8p 646ed5de52
Added cover.group platform (replaces #12303) (#12692)
* Added cover.group platform
* Added async/await, smaller changes
* Made (async_update) methods regular methods
* Small improvements
* Changed classname
* Changes based on feedback
* Service calls
* update_supported_features is now a callback method
* combined all 'update_attr_*' methods in 'async_update'
* Small changes
* Fixes
   * is_closed
   * current_position
   * current_tilt_position
* Updated tests
* Small changes 2
2018-03-15 12:31:31 +01:00
Julius Mittenzwei 3713dfe139 Removing asyncio.coroutine syntax from some components (#12507)
* Removing asyncio.coroutine syntax (first steps)

* merge conflict

* fixed small bug

* pylint
2018-02-24 10:24:33 -08:00
Scott Bradshaw 156206dfee OpenGarage - correctly handle offline status (#12612) (#12613) 2018-02-22 21:53:08 -08:00
Paulus Schoutsen 3fd61d8f45 Update voluputous (#12463)
* Update voluputous

* Fix http config

* Fix optional with default=None

* Optional, default=none

* Fix defaults in voluptuous schemas

* Fix tests

* Fix update error

* Lint
2018-02-17 10:29:14 +01:00
Julius Mittenzwei ae32d208d9 Cleanup of knx component (#12408) 2018-02-14 22:10:12 -08:00
Paulus Schoutsen 5d15b257c4
Fix line endings [skipci] (#12333) 2018-02-11 23:07:28 -08:00
Otto Winter 678f284015 Upgrade pylint to 1.8.2 (#12274)
* Upgrade pylint to 1.8.1

* Fix no-else-return

* Fix bad-whitespace

* Fix too-many-nested-blocks

* Fix raising-format-tuple

See https://github.com/PyCQA/pylint/blob/master/doc/whatsnew/1.8.rst

* Fix len-as-condition

* Fix logging-not-lazy

Not sure about that TEMP_CELSIUS though, but internally it's probably just like if you concatenated any other (variable) string

* Fix stop-iteration-return

* Fix useless-super-delegation

* Fix trailing-comma-tuple

Both of these seem to simply be bugs:
 * Nest: The value of self._humidity never seems to be used anywhere
 * Dovado: The called API method seems to expect a "normal" number

* Fix redefined-argument-from-local

* Fix consider-using-enumerate

* Fix wrong-import-order

* Fix arguments-differ

* Fix missed no-else-return

* Fix no-member and related

* Fix signatures-differ

* Revert "Upgrade pylint to 1.8.1"

This reverts commit af78aa00f125a7d34add97b9d50c14db48412211.

* Fix arguments-differ

* except for device_tracker

* Cleanup

* Fix test using positional argument

* Fix line too long

I forgot to run flake8 - shame on me... 🙃

* Fix bad-option-value for 1.6.5

* Fix arguments-differ for device_tracker

* Upgrade pylint to 1.8.2

* 👕 Fix missed no-member
2018-02-11 09:20:28 -08:00
cdce8p 231b62d043 Fix cover service description (#12243)
Parameter for `set_cover_tilt_position` is `tilt_position` not `position`.
2018-02-08 16:09:42 +01:00
Thijs de Jong 702b1be985 Set tahoma cover update interval to default (#12232)
revert 35f35050ff158b423dc437c66bdea5ebcbabc009#diff-c65eb52376398392f1395f8127364078
2018-02-08 12:20:51 +01:00
Anders Melchiorsen aa9b5e6ea5 Return of entity_id in template platforms (#12234) 2018-02-07 22:46:14 -08:00
Paulus Schoutsen e51427b284 Entity registry (#11979)
* Entity#unique_id defaults to None

* Initial commit entity registry

* Clean up unique_id property

* Lint

* Add tests to entity component

* Lint

* Restore some unique ids

* Spelling

* Remove use of IP address for unique ID

* Add tests

* Add tests

* Fix tests

* Add some docs

* Add one more test

* Fix new test…
2018-01-30 10:39:39 +01:00
Otto Winter 8dcfd35b8b Spelling fixes (#12041)
* Spelling fixes

*Lots* of them.

* Spelling breaking changes

* Fix lint errors
2018-01-29 23:37:19 +01:00
Otto Winter 38fd9b65bf Fix MQTT cover availability subscription (#12036) 2018-01-29 23:19:08 +01:00
Ville Skyttä 384f63dd1d Typing fixes (#12015)
* .gitignore: Add .mypy_cache

* Typing fixes
2018-01-29 00:24:08 -08:00
Ville Skyttä 55ee8959ba Spelling fixes (#11940) 2018-01-27 11:58:27 -08:00
William Scanlon 5123487705
Update python-wink version and multiple wink fixes/updates. (#11833) 2018-01-25 11:31:38 -05:00
Paul Annekov 3417c6ad8d Checking Xiaomi Aqara devices unavailability states (#11631)
* added unavailability tracker, updated sensor component

* change hass argument position according to position in binary_sensor

* added hass argument to binary_sensor, updated is_on(), it can be UNAVAILABLE now

* updated switch component to support unavailability feature

* updated light component to support unavailability feature

* updated cover component to support unavailability feature

* set _hass property

* added unavailability tracker, updated sensor component

* change hass argument position according to position in binary_sensor

* added hass argument to binary_sensor, updated is_on(), it can be UNAVAILABLE now

* updated switch component to support unavailability feature

* updated light component to support unavailability feature

* updated cover component to support unavailability feature

* set _hass property

* fixed error with wrong arguments number during callback call

* reset unavailability state on new message received from device

* use locks to fix race condition during managing _state property

* overriden state() method for some components to check for STATE_UNAVAILABLE and return it instead e.g. STATE_OFF

* fixed linter

* removed blank line

* use available() method instead of changing _state

* filter motion sensors 'heartbeat', was removed from PyXiaomiGateway

* remove self._hass, use self.hass set by HA on attach

* self.push_data now running in the event loop, use async_schedule_update_ha_state()

* merge fix

* removed accidentally added home-assistant-polymer

* bump PyXiaomiGateway version to 0.8.0

* bump PyXiaomiGateway to 0.8.0

* updated methods names and annotations
2018-01-23 10:22:43 +01:00
Fabian Affolter 47e31dc9ee Fixes for PEP257 (#11810)
* Fixes for PEP257

* More updates
2018-01-20 22:35:38 -08:00
Steaff c48ef281ab Homematic ip tilt covers (#11650)
* add pyhomematic support for ip and tiltable covers

* use cached data in current_cover_tilt_position

* check for existance not for None

* reformatting

* check node for LEVEL_2
2018-01-18 23:20:05 -08:00
Thijs de Jong aac01cb096 Fix Tahoma device class (#11745)
* fix device class

* edit description
2018-01-17 21:20:23 -08:00
Giuseppe 9d67d229fa Fixes and enhancements for the Tahoma platform (#11547)
* Strip off the RTS/IO ID from the entity ID

* Ignore exception thrown when the device does not provide an active state

* Send actions with a label for easier identification in the Tahoma log

* Linting

* Strip off the RTS/IO ID from the entity ID, take 2

As per suggestions, let HA do the standard initialization and assign
an appropriate entity_id, instead of overriding it with the lengthy
unique_id coming from the TaHoma devices.
2018-01-13 21:24:10 +01:00
Nicko van Someren 3e43f4e58e Adding support for Lutron covers (#11602)
* Adding support for Lutron Radio RA2 shades as cover components.

* Adding initial version of the Lutron shades component.

* Fixed line-length violation detected by Hound.
2018-01-13 19:11:20 +01:00
Thijs de Jong 5e81736f88 patch stop command (#11612) 2018-01-13 09:06:37 +01:00
Daniel Høyer Iversen 0409192e64 Bugfix and cleanup for Rfxtrx (#11600)
* rfxtrx clean up

* rfxtrx clean up

* rfxtrx clean up
2018-01-12 11:52:53 -08:00
Thijs de Jong cc236529c4 Fix Tahoma stop command for 2 types of shutters (#11588)
* add working stop command

This fixes the stop command for 2 types of roller shutters

* fix line too long

* fix indentation

* fix indentation
2018-01-12 16:04:44 +01:00
Thijs de Jong 02979db3d6 Add Velux Windows to Tahoma (#11538)
* Add Velux Windows to Tahoma

* fix linit

* add supported Tahoma devices by @glpatcern

* hound

* lint

* fix logging

* lint

* lint

* remove blank line after docstring

* changes based on notes by @armills

* fix logging
2018-01-10 09:41:16 -05:00
Anders Melchiorsen 9e0ca719ed Deprecate explicit entity_id in template platforms (#11123)
* Deprecate explicit entity_id in template platforms

* Use config validator for deprecation

* Fix copy/paste typos

* Also print the config value

* Add test for config validator

* Assert the module name that logged the message
2018-01-10 00:06:26 -08:00
Paulus Schoutsen 88b70e964c
Remove execution file perm (#11563) 2018-01-09 23:55:14 -08:00
Anders Melchiorsen 8267a21bfe Lazy loading of service descriptions (#11479)
* Lazy loading of service descriptions

* Fix tests

* Load YAML in executor

* Return a copy of available services to allow mutations

* Remove lint

* Add zha/services.yaml

* Only cache descriptions for known services

* Remove lint

* Remove description loading during service registration

* Remove description parameter from async_register

* Test async_get_all_descriptions

* Remove lint

* Fix typos from multi-edit

* Remove unused arguments

* Remove unused import os

* Remove unused import os, part 2

* Remove unneeded coroutine decorator

* Only use executor for loading files

* Cleanups suggested in review

* Increase test coverage

* Fix races in existing tests
2018-01-07 14:54:16 -08:00
Julius Mittenzwei efb83dde19 More tolerant KNX component if gateway cant be connected (#11511)
* Issue #11432: Do not stop initializing KNX when tunelling device cant be reached

*  Issue #11432: Mark devices as unavailable if gateway cant be connected
2018-01-07 13:39:14 -08:00
Thijs de Jong 35f35050ff Set tahoma cover scan interval to 60 seconds (#11447)
* Increase tahoma scan interval to 60

* import timedelta

* fix lint
2018-01-05 01:02:31 +01:00
cdce8p 65df6f0013 Fix CONF_FRIENDLY_NAME (#11438) 2018-01-03 23:52:36 +01:00
Dan Nixon f0bf7b0def More support for availability reporting on MQTT components (#11336)
* Abstract MQTT availability from individual components

- Moved availability topic and payloads to MQTT base schema.
- Updated components that already report availability:
  - Switch
  - Binary sensor
  - Cover

* Add availability reporting to additional MQTT components

- Light
- JSON light
- Template light
- Lock
- Fan
- HVAC
- Sensor
- Vacuum
- Alarm control panel

* Annotate MQTT platform coroutines
2018-01-01 18:32:29 -08:00
Conrad Juhl Andersen 05926b1994 xiaomi_aqara: Fix covers never being closed (#11319)
Bug in equality testing
2017-12-26 23:35:48 +01:00
Greg Laabs d687bc073e Huge ISY994 platform cleanup, fixes support for 5.0.10 firmware (#11243)
* Huge ISY994 platform cleanup, fixes support for 5.0.10 firmware

# * No more globals - store on hass.data
# * Parent ISY994 component handles categorizing nodes in to Hass components, rather than each individual domain filtering all nodes themselves
# * Remove hidden string, replace with ignore string. Hidden should be done via the customize block; ignore fully prevents the node from getting a Hass entity
# * Removed a few unused methods in the ISYDevice class
# * Cleaned up the hostname parsing
# * Removed broken logic in the fan Program component. It was setting properties that have no setters
# * Added the missing SUPPORTED_FEATURES to the fan component to indicate that it can set speed
# * Added better error handling and a log warning when an ISY994 program entity fails to initialize
# * Cleaned up a few instances of unecessarily complicated logic paths, and other cases of unnecessary logic that is already handled by base classes

* Use `super()` instead of explicit base class calls

* Move `hass` argument to first position

* Use str.format instead of string addition

* Move program structure building and validation to component

Removes the need for a bunch of duplicate exception handling in each individual platform

* Fix climate nodes, fix climate names, add config to disable climate

Sensor platform was crashing when the ISY reported climate nodes. Logic has been fixed. Also added a config option to prevent climate sensors from getting imported from the ISY. Also replace the underscore from climate node names with spaces so they default to friendly names.

* Space missing in error message

* Fix string comparison to use `==`

* Explicitly check for attributes rather than catch AttributeError

Also removes two stray debug lines

* Remove null checks on hass.data, as they are always null at this point
2017-12-26 09:26:37 +01:00
Greg Laabs 1c8b5838cd ISY994 sensor improvements (#10805)
* Fire events for ISY994 control events

This allows hass to react directly to Insteon button presses (on switches and remotes), including presses, double-presses, and long holds

* Move change event subscription to after entity is added to hass

The event handler method requires `self.hass` to exist, which doesn't have a value until the async_added_to_hass method is called. Should eliminate a race condition.

* Overhaul binary sensors in ISY994 to be functional "out of the box"

We now smash all of the subnodes from the ISY994 in to one Hass binary_sensor, and automatically support both paradigms of state reporting that Insteon sensors can do. Sometimes a single node's state represents the sensor's state, other times two nodes are used and only "ON" events are sent from each. The logic between the two forunately do not conflict so we can support both without knowing which mode the device is in.

This also allows us to handle the heartbeat functionality that certain sensors have - we simply store the timestamp of the heartbeat as an attribute on the sensor device. It defaults to Unknown on bootup if and only if the device supports heartbeats, due to the presence of subnode 4.

* Parse the binary sensor device class from the ISY's device "type"

Now we automatically know which sensors are moisture, motion, and openings! (We also reverse the moisture sensor state, because Insteon reports ON for dry on the primary node.)

* Code review tweaks

The one material change here is that the event subscribers were moved to the `async_added_to_hass` method, as the handlers depend on things that only exist after the entity has been added.

* Handle cases where a sensor's state is unknown

When the ISY first boots up, if a battery-powered sensor has not reported in yet (due to heartbeat or a change in state), the state is unknown until it does.

* Clean up from code review

Fix coroutine await, remove unnecessary exception check, and return None when state is unknown

* Unknown value from PyISY is now -inf rather than -1

* Move heartbeat handling to a separate sensor

Now all heartbeat-compatible sensors will have a separate `binary_sensor` device that represents the battery state (on = dead)

* Add support for Unknown state, which is being added in next PyISY 

PyISY will report unknown states as the number "-inf". This is implemented in the base ISY994 component, but subcomponents that override the `state` method needed some extra logic to handle it as well.

* Change a couple try blocks to explicit None checks

* Bump PyISY to 1.1.0, now that it has been published!

* Remove -inf checking from base component

The implementation of the -inf checking was improved in another branch which has been merged in to this branch already.

* Restrict negative-node and heartbeat support to known compatible types

Not all Insteon sensors use the same subnode IDs for the same things, so we need to use different logic depending on device type. Negative node and heartbeat support is now only used for leak sensors and open/close sensors.

* Use new style string formatting

* Add binary sensor detection for pre-5.x firmware

Meant to do this originally; writing documentation revealed that this requirement was missed!
2017-12-13 20:14:56 -08:00
perfalk 3b228c78c0 Added support for cover in tellstick (#10858)
* Added support for cover in tellstick

* Fixed comments from PR

* Fixed comments from PR

* Address comments
2017-12-10 17:35:10 +01:00
Alan Fischer 39d33c97ff Added Vera scenes (#10424)
* Added Vera scenes

* Fixed flake8 issues

* Fixed comments

* Moved vera to use hass.data

* Made requested changes
2017-12-07 07:47:19 +01:00
Philip Kleimeyer b548116f9b Tahoma platform for Somfy Covers and Sensors (#10652)
Tahoma platform for Somfy Covers and Sensors
2017-11-19 21:35:13 +01:00
marthoc 309e493e76 Add code to enable discovery for mqtt cover (#10580)
* Add code to enable discovery for mqtt cover

* Fix pylint error
2017-11-14 20:19:15 -08:00
Matthew Donoughe e7dc96397c upgrade to new pylutron_caseta with TLS (#10286)
* upgrade to new pylutron with TLS

* rename configuration options

* change more methods to coroutines

* use async_add_devices
2017-11-10 12:17:25 +01:00
Pascal Vizeli f463f4d8c6
WIP: Cleanup async stuff on templates (#10275)
Cleanup async stuff on templates
2017-11-01 15:48:09 +01:00
Fabian Affolter cc293db5ab
Update services.yaml files (#10229)
* Add period to the description

* Update abbreviation
2017-10-30 21:39:12 +01:00
Aaron Bach 646c03eea1 Add entity_picture_template options to Template Cover, Template Light, Template Sensor, and Template Switch (#9854)
* Re-adding cover

* Re-adding light

* Re-adding sensor

* Re-adding switch

* Re-added tests

* Fixing missing imports in rebased test

* Fixing broken tests

* Owner-requested changes

* Owner-requested changes

* Fixed exception
2017-10-30 09:28:37 -07:00
Pascal Vizeli c1b197419d Fix async probs (#9924)
* Update entity.py

* Update entity_component.py

* Update entity_component.py

* Update __init__.py

* Update entity_component.py

* Update entity_component.py

* Update entity.py

* cleanup entity

* Update entity_component.py

* Update entity_component.py

* Fix names & comments / fix tests

* Revert deadlock protection

* Add tests for entity

* Add test fix name

* Update other code

* Fix lint

* Remove restore state from template entities

* Lint
2017-10-19 10:56:25 +02:00
pascal cb52b80f7d missing is_closed ( rflink cover fix ) (#9776)
* Added is_closed

* whitespaces --

* removed whitespace
2017-10-09 16:57:44 +02:00
pascal cc5256b8fb Cover component for RFlink (#9432)
* second try on rflink / cover

* no newline at end of file

* changed entity

* fixed comments from pvizeli

* removed :

* removed return 'unknown'

* Fixed comments from Rytilahti

* removed newline

* Reverted to None

* cleanup

* Cleanup
2017-09-29 00:49:03 +02:00
marthoc a298b0790b MQTT Cover: Add availability topic and configurable payloads (#9445)
* MQTT Cover - Add availability_topic for online/offline status

Added topic, configurable payloads, and tests.

* Merge branch 'dev' into mqtt-cover-availability

* Revert "Merge branch 'dev' into mqtt-cover-availability"

This reverts commit 46d29794ba.

* Added newline at end of test_mqtt.py

* Fixed lint issue (newline at EOF)

* Fixed lint issue (newline at EOF)

* Updated call signature for other tests

* Fixed availability message callback
2017-09-25 19:35:11 +02:00
Julius Mittenzwei 5fd9220812 Fix typo within cover/knx https://github.com/XKNX/xknx/issues/64 (#9527) 2017-09-21 21:55:33 +02:00
Julius Mittenzwei 0f7c35859b Small improvement of KNX Covers (#9476)
* Refactoring of Cover abstraction. Fixes
https://github.com/XKNX/xknx/issues/57 and
https://github.com/home-assistant/home-assistant/issues/9414

* Requested changes by pvizeli
2017-09-18 21:44:26 +02:00
Mister Wil c44397e257 Abode services, events, lights, cameras, automations, quick actions. (#9310)
* Updated to latest AbodePy version. Added services and events. Added new device types. Added exclude, light, and polling config options.

* Disable the event service if polling is enabled.

* Addressed all CR's

* Removed duplicated super call.

* Name config option now used. Removed deprecated DEFAULT_NAME.

* Modified partial to move event to first param.
2017-09-18 17:39:41 +02:00
Daniel Høyer Iversen 4126b8bd13 Rename xiaomi #9425 (#9426)
* rename xiaomi to xiaomi_aqara

* rename xiaomi vacuum and xiaomi phillips light to xiaomi miio

* update discovery and tests

* style

* update discovery and tests

* Still use Philips as name
2017-09-14 18:49:03 -04:00
Pascal Vizeli 90f9a6bc0a Cleanup and simplitfy the async state update (#9390)
* Cleanup and simplitfy the async state update

* Update test_entity.py
2017-09-12 10:01:03 +02:00
Julius Mittenzwei 77d0ad1797 Stable and asynchronous KNX library. (#8725)
* First draft of XKNX module for Home-Assistant

* XKNX does now take path of xknx.yaml as parameter

* small fix, telegram_received_callback has different signature

* changed method of registering callbacks of devices

* removed non async command lines from xknx

* telegram_received_cb not needed within HASS module

* updated requirements

* Configuration if XKNX should connect via Routing or Tunneling

* bumping version to 0.6.1

* small fix within xknx plugin

* bumped version

* XKNX-Switches are now BinarySensors and Logic from Sensor was moved to BinarySensor

* renamed Outlet to Switch

* pylint

* configuration of KNX lights via HASS config, yay!

* changed name of attribute

* Added configuration for xknx to switch component

* added support for sensors within hass configuration

* added support for climate within hass configuration

* Thermostat -> Climate

* added configuration support for binary_sensors

* renamed Shutter to Cover

* added configuration support for cover

* restructured file structure according to HASS requirements

* pylint

* pylint

* pylint

* pylint

* pylint

* pylint

* updated version

* pylint

* pylint

* pylint

* added setpoint support for climate devices

* devices are now in a different module

* more asyncio :-)

* pydocstyle

* pydocstyle

* added actions to binary_sensor

* allow more than one automation

* readded requirement

* Modifications suggested by hound

* Modifications suggested by hound

* Modifications suggested by hound

* Modifications suggested by hound

* xknx now imported as local import

* hound *sigh*

* lint

* 'fixed' coverage.

* next try for getting gen_requirements_all.py working

* removed blank line

* XKNX 0.7.1 with logging functionality, replaced some print() calls with _LOGGER

* updated requirements_all.txt

* Fixes issue https://github.com/XKNX/xknx/issues/51

* https://github.com/XKNX/xknx/issues/52 added raw access to KNX bus from HASS component.

* bumped version - 0.7.3 contains some bugfixes

* bumped version - 0.7.3 contains some bugfixes

* setting setpoint within climate device has to be async

* bumped version to 0.7.4

* bumped version

* https://github.com/XKNX/xknx/issues/48 Adding HVAC support.

* pylint suggestions

* Made target temperature and set point required attributes

* renamed value_type to type within sensor configuration

* Issue https://github.com/XKNX/xknx/issues/52 : added filter functionality for not flooding the event bus.

* suggestions by pylint

* Added notify support for knx platform.

* logging error if discovery_info is None.

* review suggestions by @armills

* line too long

* Using discovery_info to notifiy component which devices should be added.

* moved XKNX automation to main level.

* renamed xknx component to knx.

* reverted change within .coveragerc

* changed dependency

* updated docstrings.

* updated version of xknx within requirements_all.txt

* moved requirement to correct position

* renamed configuration attribute

* added @callback-decorator and async_prefix.

* added @callback decorator and async_ prefix to register_callbacks functions

* fixed typo

* pylint suggestions

* added angle position and invert_position and invert_angle to cover.knx

* typo

* bumped version within requirements_all.txt

* bumped version

* Added support for HVAC controller status
2017-09-07 00:11:55 -07:00