Commit Graph

846 Commits (f51163f803e408fab0bf7aaab541752d9e66af63)

Author SHA1 Message Date
Pascal Vizeli b5fb558c62 Bugfix rpi_rf cleanup (#6513)
Add an optional extended description…
2017-03-10 14:56:13 +01:00
Craig J. Ward 330d352d3a Insteon lib (#6505)
* use lib with caching to reduce collisions

* use 0.43

* change requirements

* update the  lib to 0.44

* update req

* fix typo

* just keep checking

* just keep checking - switch

* use 0.45 with file cache

* requirements

* Update requirements_all.txt

* Update insteon_local.py

* Update requirements_all.txt

* Update insteon_local.py

* update library

* fix lint
2017-03-10 11:14:31 +01:00
Robbie Trencheny 11c4d3892f Merge pull request #6001 from jumpkick/patch-2
Improvements for WeMo Insight switches
2017-03-09 21:14:33 -08:00
pvizeli bcd4def0ae pump version 0.3 / make a lot of improvments 2017-03-09 12:00:50 +01:00
Pascal Vizeli 185ccc4fc4 Fix some things 2017-03-09 01:00:57 +01:00
pvizeli 93118fcade Android IP Cam support 2017-03-08 17:48:55 +01:00
siebert 2c5d3387f2 Fix wake_on_lan ping for Linux. (#6480) 2017-03-07 20:57:35 -08:00
Andrey eaaa0442e2 Add a Z-wave workaround to do full refresh on update (#6403)
* Add Zwave refresh services

* services file

* Use dispatcher

* Add zwave prefix to signal

* Add a Z-wave workaround to do full refresh on update
2017-03-05 12:55:52 -08:00
Teemu R 96aae1292b switch.tplink: catch exceptions coming from pyHS100 to avoid flooding the logs when the plug is not available (#6400) 2017-03-05 08:44:34 +01:00
Pascal Vizeli 8232f1ef65 Cleanup async handling (#6388)
* Cleanups unneeded blocks

* Cleanup bootstrap

* dedicated update_ha_state

* Fix imap_email_content

* fx tests

* Fix lint & spell
2017-03-04 15:10:36 -08:00
siebert a5081ac307 Fix wake_on_lan for german version of Windows 10 (#6397) (#6398) 2017-03-04 09:58:01 -08:00
Pascal Vizeli 55dc483c91 Template switch change flow / add restore (#6356)
* Template switch change flow / add restore

* fix tests

* fix binary_sensor template
2017-03-02 14:09:53 +01:00
martinfrancois a08539d88d Added support for multiple codes executed in a row (#5908)
* Added support for multiple codes executed in a row

now codes can be specified either by simply providing a single code, which will then be sent like usual, or multiple codes can be executed in a row, specified in a comma delimited format in the configuration.yaml. For example: 111111,222222,333333,444444 would mean 111111 would be sent first, followed by 222222 and 333333 and 444444.

* rpi_rf: added line breaks to not exceed 79 characters per line

* include validation for correct formatting of codes

added regex which only allows either a single number (like 1252456245) or a sequence of commas followed by another number.

* added line breaks to not exceed 79 characters per line

* fix for 'continuation line under-indented for visual indent'

* another try at 'continuation line under-indented for visual indent'

* changed from regex to list for easier maintainability

* removed unnecessary splitting of strings
2017-03-02 00:10:49 -08:00
Pascal Vizeli 41f558b181 Bootstrap / Component setup async (#6264)
* Bootstrap / Entiy setup async

* Cleanup add_job stuff / return task/future object

* Address paulus comments / part 1

* fix install pip

* Cleanup bootstrap / move config stuff to config.py

* Make demo async

* Further bootstrap improvement

* Address Martin's comments

* Fix initial tests

* Fix final tests

* Fix bug with prepare loader

* Remove no longer needed things

* Log error when invalid config

* More cleanup

* Cleanups platform events & fix lint

* Use a non blocking add_entities callback for platform

* Fix Autoamtion is setup befor entity is ready

* Better automation fix

* Address paulus comments

* Typo

* fix lint

* rename functions

* fix tests

* fix test

* change exceptions

* fix spell
2017-02-28 20:33:19 -08:00
Andrey b27ba9660b Some zwave cleanup (#6203) 2017-02-24 16:17:27 +02:00
jumpkick fc5e25a07b Incorporate comment suggestions
- Separate attribs from coffeemaker condition
- Set power units for threshold to mW to be consistent with others
- Adjust on-time labels to be more clear
2017-02-23 18:03:49 -05:00
Andrey 1d32bced1c Create zwave devices on OZW thread and only add them during discovery (#6096)
* Create zwave devices on OZW thread and only add them during discovery.

* Read and write devices dict from loop thread.

* More async

* replace callback with coroutine

* import common function instead of callin git
2017-02-23 13:06:28 -08:00
Pascal Vizeli 106b7a9d8f Cleanup run_callback_threadsafe (#6187)
* Cleanup run_callback_threadsafe

* fix spell

* Revert image_processing, they need to wait for update
2017-02-23 12:57:25 -08:00
Erik 1c6ba989a9 Support for naming vehicle. Support for selecting what resources to display 2017-02-23 12:00:51 +01:00
jumpkick ef87d4dad4 Update device_state_attributes only
This gets rid of the other stuff and just updates device_state_attributes, leaving the default properties alone.
2017-02-23 04:54:09 -05:00
Daniel Høyer Iversen 6c91e04852 Refactor broadlink (#6168)
* refactor broadlink

* typo
2017-02-22 22:11:49 +01:00
Pascal Vizeli b0d3bbed79 Convert mqtt platforms to async (#6145)
* Convert mqtt platforms to async

* fix lint

* add more platforms

* convert mqtt_eventstream

* fix lint / add mqtt_room

* fix lint

* fix test part 1

* fix test part 2

* fix out of memory bug

* address comments
2017-02-22 09:43:22 +01:00
Erik Eriksson 65ed85c6eb volvooncall: fix missing property. see vehicle when discovered. (#6144) 2017-02-22 00:24:42 -08:00
David McNett 3beb87c54d New component 'insteon_plm' and related platforms (#6104)
* Connect to PLM and process simple protocol callbacks

* Baseline commit

* Connect to PLM and process simple protocol callbacks

* Baseline commit

* Connection working again

* Async add devices is working via callback now

* Beginning to interface with PLM library for control and state

* Deal with brightness in 255 levels with library

* Change sub names to match API changes

* Remove PLM-level update callback

* Support dimmable based on underlying PLM device attributes

* Expand to non-light platforms

* Stubs for turn on and off

* Current version of Python library

* Amend to use switch device attributes

* Use asyncio endpoints for control

* Add logging line

* Bump module version to 0.7.1

* Auto-load platforms, display device info/attributes

* Unify method name for getting a device attribute

* Require Current version of insteonplm module

* Import the component function in each platform in the balloob-recommend manner

* For consistency, handle switch state as onlevel just like lights

* Use level 0xff for on state, even with binary switches

Observing the behavior of a 2477S switch, it looks like even the non-dimmable
devices use 0x00 and 0xff for off/on respectively.  I was using 0x01 for on
previously, but that yields unnecessary state change callbacks when message
traffic ends up flipping the onlevel from 0xff to 0x01 or 0x01 to 0xff.

* Use sensorstate attribute for sensor onoff

* Move new device callback to devices attribute

* Add support for platform override on a device

* Bump version of insteonplm module

* Default overrides is an empty list

* Avoid calling private methods when doing common attributes

* Remove unused CONF_DEBUG for now

* flake8 and pylint code cleanup

* Move get_component to local function where it is needed

* Update to include insteonplm module.

* New files for insteon_plm component

* Legitimate class doctring instead of stub

* Docstring changes.

* Style changes as requested by @SEJeff

* Changes requested by @pvizeli

* Add @callback decorator to callback functions

* Opportunistic platform loading triggered by qualifying device detection

Instead of loading all the constituent platforms that comprise the insteon_plm
component, instead we defer and wait until we receive a callback for a device
that requires the platform.
2017-02-21 08:53:39 +01:00
Pascal Vizeli e425801fe0 Homematic cleanup & hass best praxis (#6121) 2017-02-20 17:07:33 +01:00
Erik Eriksson 9e73115337 Updated volvooncall library + support sensors, heater and lock (#6052) 2017-02-18 17:09:25 -08:00
John Arild Berentsen 799fbe42f8 zwave refactor, don't use ozw values directly in properties. (#5961)
* First round of not using values directly

* Round two

* lint

* Round four

* Conflict

* Round five

* Update zwave.py

* round six

* Docstring

* flakywakie

* Fetch values in constructor

* Blank line removal

* Set attributes in callback

* Docstring

* Round seven

* Ughgit add homeassistant/components/lock/zwave.py!

* Sloppy code
2017-02-17 23:56:05 -08:00
jumpkick f6e46aecf5 Update wemo.py 2017-02-15 17:32:45 -05:00
jumpkick e9cf5f6f42 Update wemo.py 2017-02-15 16:58:11 -05:00
jumpkick e221c8a37d Update wemo.py 2017-02-15 16:57:16 -05:00
jumpkick b163544e3c Back to you travis.... 2017-02-15 16:47:02 -05:00
jumpkick a718e92708 Update wemo.py
trailing whitespace... (argh... the bot should just trim it)
2017-02-15 15:40:02 -05:00
jumpkick 44d274e428 Update wemo.py
* continuation line under-indented for visual indent
2017-02-15 15:38:41 -05:00
jumpkick c404fb7142 Update wemo.py
* Reordered datetime import
* Spaces by 4
2017-02-15 15:34:42 -05:00
jumpkick 29c7987453 Improvements for WeMo Insight switches
* Changes current power units to watts
* Adds power on times and additional totals
2017-02-14 18:29:23 -05:00
Pascal Vizeli 80bc2666ac Make homematic climate dynamic for datapoints. (#5993)
* Make homematic climate dynamic for datapoints.

* Code cleanup

* Add more option

* add options

* Pump version 0.1.22

* optimaze
2017-02-14 23:19:57 +01:00
Fabian Affolter 88653e66c8 Style updates (#5878)
* Use consts, update quoting, and update comments

* Update log message

* Update docstrings

* Update log messages

* Update log messages

* Update style

* Fix typo

* Add newline

* Fix indent

* Fix line too long
2017-02-11 11:29:37 -08:00
Christian Brædstrup a150a69cca D-Link switch version bump of external library (#5843) 2017-02-10 12:00:28 +01:00
Yannic-HAW 4a341ff55f - added send packet service to send ir packets directly from scripts (no need to define a switch for each command) (#5768)
- changed ip suffix of SERVICE_LEARN to use _ instead of . as ip seperator to avoid errors if used in yaml
2017-02-06 07:53:58 +01:00
Wolf-Bastian Pöttner e831a2705e Add support for FRITZ!DECT wireless switches based on fritzhome (#5541) 2017-02-02 23:29:18 -08:00
William Scanlon 80a794e587 Wink AC and addidtional sensor support (#5670)
* Added door bell sensors

* Initial support for AC units.

* Added new device service

* Quirky Aros AC unit support

* Use super() everywhere and error checking for token request.

* Ignore camera sensors during setup of alarms.

* Added manufacturer/device attributes to all wink devices.

* Fixed style errors

* Fixed remaining lint errors.
2017-02-01 22:43:12 -08:00
Pascal Vizeli 10a104271e Cleanup climate platform for async update_ha_state / migrate generic thermostat (#5679)
* Cleanup climate from blocking stuff / migrate generic

* Migrate generic thermostat

* fix tests

* fix lint
2017-02-01 21:44:05 -08:00
Johan Bloemberg cabc4dff03 Use same pattern for device defaults in both platforms. (#5682) 2017-02-01 10:42:50 +01:00
Johan Bloemberg bbda2a72f4 Rflink 433Mhz gateway platform and components (#4547)
* Initial sketches of rflink component.

* Add requirement.

* Properly load configuration.

* Bump rflink for graceful parse errors and protocol callback.

* Cleanup, documentation and linting.

* More documentation, first sensor implementation (temp & hum).

* Add brightness/dim support for newkaku protocol.

* Use separate class for dimmables.

* Make sure non-dimmable newkaku devices are turned on.

* Move some code around, add switches. Support loading from config.

* Fix bug in ignoring devices.

* Fix initial state assumption.

* Improve reliability on invalid conditions.

* Allow configuration of group for new devices.

* Sensor icons.

* Fix parsing negative numbers.

* Correct icon.

* Allow sending commands serial.

* Pluralize.

* Allow adding sensors from config.

* Fix ignoring devices and bugs in previous commit.

* Share know devices so devices from configuration don't get added as lights.

* Lookup unit from value_key.

* Remove debug.

* Start implementing event protocol in place of packet protocol.

- Added first test suite for sensors.
- This currently breaks light and switch.

* Refactor switch component to fit new rflink changes. Add test suite.

* Fix style.

* Refactor and test lights. Bring coverage to 100%.

* Use non-broken and production tested rflink module.

* Update requirements.

* Bump for logging.

* Improve readability.

* Do not use global variable but keep known device state in intended place.

* Improve docs.

* Make icon support generic.

* Disable overriding icons in config, as it belongs in customization. Only keep custom icon for entities that are able to detect a icon based on the thing they represent (sensors in this case).

* Implement configuration schema, overall refactor of magic values.

* Fix bug in config/test wait_for_ack.

* Small refactors.

* Move command logic into separate class.

* Convert command sending logic to class based pattern instead of using the event bus.

* Start not using bus for rflink event propagation to platforms.

* Do not use event bus for all entity types.

* Fire an event on the bus for every switch incoming rflink command.

* Resolve lint errors, remove some old code.

* Known devices no longer need to be registered separately.

* Log bus events.

* Event callback is a..... callback.

* Use full entity id for events.

* Move event sending to entity.

* Log incoming events.

* Make firing events optional inline with rfxtrx.

* Add foundation for signal repetition.

* Add signal repetition config and tests.

* Make plain switchable type explicitly configurable.

* Enable default entity settings for automatically added entities as well.

* Prevent default configuration leaking accross entities.

* Make sure device defaults don't get overwritten by defaults further down.

* Don't let fast state switching and repetitions turn your house into a disco.

* Make repetitions more responsive.

* Disable on/off fallback on dimmables as it currently doesn't play nice with repetitions.

* Use rflink that allows send_command_ack to be safely cancelled.

* Reduce duplication and make repeat work for non-ack.

* Implement reconnection logic.

* Improve reconnection logic.

* Also cancel repetitions when entity state is changed due to external command.

* Update requirements.

* Fix linting.

* Fix spelling.

* Don't lie.

* Fix lint.

* Support for automatically creating protocol translation (fixes spaces in device names).

* Returned support for dimmable and on/off entity.

* Duplicate code to fix linting issues with inheritance.

* Allow overriding unit of measurement from config.
2017-01-31 08:11:52 -08:00
David-Leon Pohl a9325ea663 Fixes: Pilight Switch rejects alphanumeric IDs #5119 (#5601) 2017-01-28 17:49:16 -08:00
Fabian Affolter 5ae5d9b576 Upgrade rpi-rf to 0.9.6 (#5611) 2017-01-28 17:05:24 -08:00
Paulus Schoutsen b4c3de3215 Fix switch.tplink doing I/O in event bus (#5589)
* Fix switch.tplink doing I/O in event bus

* Update tplink.py
2017-01-27 22:45:57 -08:00
Teemu R 86dfa7ad25 [switch.flux] Allow disabling setting the brightness (#5407)
* flux: allow disabling setting the brightness

* Use separate boolean for disabling brightness adjustment

* Update flux.py
2017-01-26 23:08:08 -08:00
Jan Losinski 41218e5a37 [switch.pilight] Implement echo config option (#5056)
* Implement echo config option for pilight

Pilight switches can get a receive code configured. If so they act on
received codes. In the current implementation "act on" means not only
to set the internal state, but also to send the code again. If the
receiver is directly parred with the switch, to act even if HA is not
running, this causes it to receive the signal twice because the HA
sends it again.

In my case this causes a dimmer to start dimming until I hit the switch
again.

This implements a "echo" argument for the receive codes that let the
user choose if a received signal should result in any sending or not.
If not, only the status of pilight will be updated.

The echo option defaults to True, as this was the default since now.
Simply set it to halse to disable this behaviour.

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>

* Add documentation to set_state in switch/pilight.

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
2017-01-26 22:40:14 -08:00
Adam Mills 923431110a [*.zwave] Refactor of zwave value_changed (#5512)
* Refactor of zwave value_changed

* Rename update_properties to update

* Revert "Rename update_properties to update"

This reverts commit 723578e7d4.
2017-01-26 22:21:33 -08:00
Daniel Høyer Iversen a465a45588 Fix for assumed state in command_line (#5578)
* Bug fix for assumed state in command_line

* command line

* command line

* command line

* command line test
2017-01-26 21:41:30 -08:00
Stu Gott 191d7b0a50 Add support for Wemo CoffeeMaker devices (#5505)
* Add support for Wemo CoffeeMaker devices

* Add CoffeeMaker to WEMO_MODEL_DISPATCH
2017-01-24 22:10:10 -08:00
Martin Hjelmare a09a772f43 Add more validation for mysensors (#5493)
* Move isdevice validator under helpers.config_validation.
* Check that all persistence files are set and are unique if any is set
  by user. This is necessary to avoid file name clashes.
* Check that a set persistence file has an existing and writable
  directory.
* Check that a device is either a valid device file, "mqtt", or a valid
  domain name or ip address.
2017-01-24 22:04:44 -08:00
William Scanlon 47bbfc309c Support for python-wink 1.0.0 (#5534) 2017-01-24 21:11:18 -08:00
Fabian Affolter b2ecaa189a [binary_sensor.arest] Fix name for sensor and shorten logger messages (#5460)
* Fix name for sensor and shorten logger messages

* Use variable as name if none is given
2017-01-24 19:54:14 +01:00
Petr Vraník 900868708e check cec message length when asking physical address (#5516)
* cec client object

* cec command structure

* autodetect source

* volume support and native source select

* switch device

* media player device

* detecting of state

* friendly names

* hdmi cec properties

* presence detection

* simplified callbacks

* stable names

* renamed methods

* code cleanup

* name with vendor

* fixed standby call name

* fake standby/poweron

* domain switch

* domain switch

* async updating

* update separated

* cec -> hass event bridge

* fixed name generation

* code cleanup

* code cleanup

* icon constants

* code cleanup

* do not register unavailable devices

* discovery of deevices

* code cleanup

* cec device discovery

* moved method implementation into child

* service descriptions

* service descriptions

* service descriptions

* changed entity init sequence

* logging cleanup

* add remove as job

* closing cec, no service schemas

* correct iterate over dictionary

* Volume by commands

* threading

* logging minimized

* get load out of main thread

* naming cleanup

* get load out of main thread

* optimized discovery

* async where possible

* cleanup logging, constructors first

* pydoc

* formatting

* no async_update from out of loop
no hiding entities
removed redundant device_state_attributes
async updating presence

* no async

* working async cec

* cec in thirdparty lib

* cec initialized oudsice

* working without SIGSEGV

* rollbacked file changed by mistake

* sending of commands

* working with ha

* using hass loop and device driven updates

* version up

* version up

* Command types in pycec, cleanup for HA integration

* Removed media player, state moved to switch

* service descriptions

* requirements: pyCEC

* line width to 79

* doc

* doc

* overindentation solved

* HDMI to uppercase

* minimal dependency on cec

* removed unwanted line

* doc wording

* margin 79

* line continuation indent

* imperative doc

* lint: indentation

* fixed overindented

* fixed overindented

* fixed overindented

* fixed overindented

* order of imports

* PEP8

* keep signature of overriding

* removed redundant blank line

* fixed update call method (#4)

* Preparation for merge to upstream (#5)

* newer version of pyCEC
* updated services.yaml
* fixed lint scrpt to operate only on python files

* pycec version up

* update services

* no coverage report

* exclude non python files from lint

* lint only on python files

* Dev (#6)

* reordered
* sending nonserialized data through hass.data
* code formatting
* code formatting
* import order

* Dev (#7)

* newer version of pyCEC
* updated services.yaml
* fixed lint scrpt to operate only on python files

* pycec version up

* update services

* no coverage report

* exclude non python files from lint

* lint only on python files

* reordered

* sending nonserialized data through hass.data

* import order

* fixed object handling

* code formatting

* Backwards compatibility of hdmi_cec (#10)

* services:
power_on
standby
active_source

* new version of pyCEC (#12)

* newer version of pyCEC

* devices config (#13)

* getting device name from config

* shutdown fix (#14)


* correct call on shutdown

* remove misplaced annotations (#15)

* Preparation for merge to upstream (#5)

* newer version of pyCEC
* updated services.yaml
* reordered
* sending nonserialized data through hass.data
* services:
power_on
standby
active_source
* code formatting
* getting device name from config
* correct call on shutdown

* pyCEC version 0.3.6 (#18)

* newer version of pyCEC
* updated services.yaml
* sending nonserialized data through hass.data
* services:
** power_on
** standby
** active_source
* getting device name from config
* correct call on shutdown
* fork new thread on multicore machines
* support both config schemas: original and new (#16)
* volume press and release support (#17)

* support for media_player (#21)

* accept hexadecimal format of commands
* support for media player
* platform customization
* type constants

* Dev (#23)

* accept hexadecimal format of commands
* support for media player
* platform customization

* TCP CEC support (#24)

* accept hexadecimal format of commands
* support for media player
* platform customization
* preparing tcp support

* volume handling (#25)

* Incorporated CR remarks (#26)

* cleanup imports
* cleanup and enhance services description
* removed unwanted file

* implemented CR remarks (#27)

* pyCEC v0.4.6
* pined dependency version
* tighten service schemas

* requirements (#28)

* incorporate remarks from users (#32)

* home-assistant-31 make mute schema better (#31)

* pycec-30 pyCEC version up (#30)

* pycec-30 pyCEC version up (#30)

* home-assistant-30 OSD display name from configuration (#30) (#33)

* Home assistant 29 (#34)

* home-assistant-29 counting from 0 (#29)

* Home assistant 31 (#35)

* home-assistant-31 add support for mute-on and mute-off (#31)

* home-assistant-31 pyCEC version up (#31)

* Home assistant 31 (#36)

* home-assistant-31 Limit OSD name to 13 chars (#31)

* home-assistant-31 Limit OSD name to 13 chars moved to CEC adapter (#31)

* home-assistant-31 version up (#31)

* home-assistant-31 formatting (#31)

* formatting

* service description

* service description

* single attribute for volume

* fixed mute on -> mute off

* moved config constant from core into component

* check cec message length when asking physical address (#38) (#38)

* cec turn on/turn off commands instead of power

* cec turn on/turn off commands instead of power
2017-01-23 13:22:39 -08:00
Fabian Affolter d5119a0520 Use device_state_attributes (#5518) 2017-01-23 13:21:12 -08:00
Craig J. Ward a89a4f39dc only check for devices when not defined in config (#5490)
* only check for devices when not defined in config

* lint
2017-01-21 14:00:56 -08:00
Petr Vraník 067e11ea5c HDMI CEC - support for devices and commands (#4781)
* cec client object

* cec command structure

* autodetect source

* volume support and native source select

* switch device

* media player device

* detecting of state

* friendly names

* hdmi cec properties

* presence detection

* simplified callbacks

* stable names

* renamed methods

* code cleanup

* name with vendor

* fixed standby call name

* fake standby/poweron

* domain switch

* domain switch

* async updating

* update separated

* cec -> hass event bridge

* fixed name generation

* code cleanup

* code cleanup

* icon constants

* code cleanup

* do not register unavailable devices

* discovery of deevices

* code cleanup

* cec device discovery

* moved method implementation into child

* service descriptions

* service descriptions

* service descriptions

* changed entity init sequence

* logging cleanup

* add remove as job

* closing cec, no service schemas

* correct iterate over dictionary

* Volume by commands

* threading

* logging minimized

* get load out of main thread

* naming cleanup

* get load out of main thread

* optimized discovery

* async where possible

* cleanup logging, constructors first

* pydoc

* formatting

* no async_update from out of loop
no hiding entities
removed redundant device_state_attributes
async updating presence

* no async

* working async cec

* cec in thirdparty lib

* cec initialized oudsice

* working without SIGSEGV

* rollbacked file changed by mistake

* sending of commands

* working with ha

* using hass loop and device driven updates

* version up

* version up

* Command types in pycec, cleanup for HA integration

* Removed media player, state moved to switch

* service descriptions

* requirements: pyCEC

* line width to 79

* doc

* doc

* overindentation solved

* HDMI to uppercase

* minimal dependency on cec

* removed unwanted line

* doc wording

* margin 79

* line continuation indent

* imperative doc

* lint: indentation

* fixed overindented

* fixed overindented

* fixed overindented

* fixed overindented

* order of imports

* PEP8

* keep signature of overriding

* removed redundant blank line

* fixed update call method (#4)

* Preparation for merge to upstream (#5)

* newer version of pyCEC
* updated services.yaml
* fixed lint scrpt to operate only on python files

* pycec version up

* update services

* no coverage report

* exclude non python files from lint

* lint only on python files

* Dev (#6)

* reordered
* sending nonserialized data through hass.data
* code formatting
* code formatting
* import order

* Dev (#7)

* newer version of pyCEC
* updated services.yaml
* fixed lint scrpt to operate only on python files

* pycec version up

* update services

* no coverage report

* exclude non python files from lint

* lint only on python files

* reordered

* sending nonserialized data through hass.data

* import order

* fixed object handling

* code formatting

* Backwards compatibility of hdmi_cec (#10)

* services:
power_on
standby
active_source

* new version of pyCEC (#12)

* newer version of pyCEC

* devices config (#13)

* getting device name from config

* shutdown fix (#14)


* correct call on shutdown

* remove misplaced annotations (#15)

* Preparation for merge to upstream (#5)

* newer version of pyCEC
* updated services.yaml
* reordered
* sending nonserialized data through hass.data
* services:
power_on
standby
active_source
* code formatting
* getting device name from config
* correct call on shutdown

* pyCEC version 0.3.6 (#18)

* newer version of pyCEC
* updated services.yaml
* sending nonserialized data through hass.data
* services:
** power_on
** standby
** active_source
* getting device name from config
* correct call on shutdown
* fork new thread on multicore machines
* support both config schemas: original and new (#16)
* volume press and release support (#17)

* support for media_player (#21)

* accept hexadecimal format of commands
* support for media player
* platform customization
* type constants

* Dev (#23)

* accept hexadecimal format of commands
* support for media player
* platform customization

* TCP CEC support (#24)

* accept hexadecimal format of commands
* support for media player
* platform customization
* preparing tcp support

* volume handling (#25)

* Incorporated CR remarks (#26)

* cleanup imports
* cleanup and enhance services description
* removed unwanted file

* implemented CR remarks (#27)

* pyCEC v0.4.6
* pined dependency version
* tighten service schemas

* requirements (#28)
2017-01-20 12:39:18 -08:00
Fabian Affolter bfc0a6a17c Use constants (#5390) 2017-01-17 23:40:34 +01:00
Tom Dickman 65bf30643a Use timezone aware timestamp in flux_update (#5378) 2017-01-16 22:55:05 -08:00
Teemu R d62b1fc808 Make initial flux update directly when turning on (#5266) 2017-01-16 22:53:34 -08:00
Martin Hjelmare 9db1aa7629 Add discovery notify support and mysensors notify (#5219)
* Add mysensors notify platform

* Make add_devices optional in platform callback function.
* Use new argument structure for all existing mysensors platforms.
* Add notify platform.
* Update mysensors gateway.

* Refactor notify setup

* Enable discovery of notify platforms.
* Update and add tests for notify component and some platforms.
* Continue setup of notify platforms if a platform fails setup.
* Remove notify tests that check platform config. These tests are not
  needed when config validation is used.
* Add config validation to APNS notify platform.
* Use discovery to set up mysensors notify platform.

* Add discovery_info to get_service and update tests

* Add discovery_info as keyword argument to the get_service function
  signature and update all notify platforms.
* Update existing notify tests to check config validation using test
  helper.
* Add removed tests back in that checked config in apns, command_line
  and file platforms, but use config validation test helper to verify
  config.
* Add a test for notify file to increase coverage.
* Fix some PEP issues.

* Fix comments and use more constants

* Move apns notify service under notify domain
2017-01-15 03:53:14 +01:00
Fabian Affolter bf3e5b460e Clean-up (#5327) 2017-01-14 09:42:45 -08:00
Fabian Affolter 2aa996b558 Update name (#5324) 2017-01-14 17:08:48 +01:00
Fabian Affolter ef4a9bf354 Add timeout to requests, remove pylint disable, and docsstrings (#5326) 2017-01-14 17:08:21 +01:00
Teemu R 5bba9a63a5 switch.tplink: bump to the newest release of pyhs100 (#5308) 2017-01-13 22:20:47 -08:00
Terry Carlin ee055651cd Update insteon_local.py (#5236)
Correct typo
2017-01-09 12:11:15 +01:00
Craig J. Ward a3971d7ad1 Insteon local (#5088)
* platform set-up begin components

* lights seem to be getting set up properly, not sure why they aren't being added...

* typo

* Dependencies line

* toggle working

* toggle working

* added the switch to insteon_local

First commit hope to test tonight or in the morning

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* move dependency declaration before import?

* Move dependencies in Switch

* Update insteon_local.py

* wait for response

* switched the while to an if

switched the while 'cmd2' not in resp: to an if 'cmd2' not in resp: this seems to have the updater working

* Switched the while sleep loop to an if

switched the wile cmd2 not ins resp to be if cmd2 not in resp seems to be working.

* Update insteon_local.py

* import statement

Updated the import statement to import the instance of the insteon_local component not the hub Instance.

* updated import and the device assignment

update the import to import the instance of the insteon_local component not the hub.

* more changes to support the import change

* more changes to support the import change

* change to hass.data and add loop logic

* &&

* Update insteon_local.py

* Update insteon_local.py

* logic fixes and throttle

* reduce polling time

* brightness support

* import util

* hound fixes

* requirements file

* more hound fixes

* newline

* newline weirdness

* lint fixes

* more lint fixes

* switch state

* Update insteon_local.py

* log cmd2 for debugging

* assume success

* remove check for none

* fix comments

* fix comments again

* fix comments, add fixed version of lib, add support for timeout, add support for port, handle invalid login and connection problems

* fix logging exception

* fix hounceci-bot errors

* fix hounceci-bot errors

* requirements fix

* unique-id changes

* make dimmer off use saved ramp rate

* configurator working for lights

* configurator working for switches?

* configurator working for switches?

* include model names and fix lint errors

* lint fix

* fix exception order

* lint fixes

* fix lint errors

* update to use insteon local 0.38

* fix device id

* move status check to library

* move status check to library

* add SKU to setup

* lint fixes

* requirements

* linting
2017-01-09 00:33:35 +01:00
Pascal Vizeli 1719d88602 Bugfix default values to timedelta (#5193)
* Bugfix default values to timedelta

* fix unittests
2017-01-06 00:16:12 +01:00
webworxshop 51446e0772 Add support for customised Kankun SP3 Wifi switches. (#5089)
* Add support for customised Kankun SP3 Wifi switches.

* Add config validation for Kankun SP3 wifi switch.

* Update kankun.py
2017-01-05 22:16:00 +01:00
Martin Vacula 6b682d0d81 Beaglebone black GPIO control by switch v2 (#4908)
* Added support for BBB GPIO

* Requirements updated

* unnecessary pylint statement removed

* Changed according arduino switch

* typo corrected

* Hound errors solved

* lint error

* Update bbb_gpio.py
2017-01-05 20:53:48 +01:00
Magnus Ihse Bursie d9614cff46 Improve async/multithreaded behavior of tellstick code (#4989)
* Refactor tellstick code for increased readability. Especially highlight if "device" is a telldus core device or a HA entity.

* Refactor Tellstick object model for increased clarity.

* Update comments. Unify better with sensors. Fix typo bug. Add debug logging.

* Refactor tellstick code for increased readability. Especially highlight if "device" is a telldus core device or a HA entity.

* Refactor Tellstick object model for increased clarity.

* Update comments. Unify better with sensors. Fix typo bug. Add debug logging.

* Fix lint issues.

* Remove global variable according to hint from balloob.

* Better async/threading behavior for tellstick.

* Fix lint/style checks.

* Use hass.async_add_job
2017-01-03 23:54:11 +01:00
Nathan Henrie b78cf4772d Add ability to set rpi_rf `tx_repeats` attribute (#5070)
* Add ability to set rpi_rf `tx_repeats` attribute

Uses the current `rpi_rf` default of 10
Closes home-assistant/home-assistant#5069

* Use `signal_repetitions` instead of `repeats` for consistency
2017-01-03 23:46:30 +01:00
Daniel Høyer Iversen ebfb2c9b26 Broadlink fix (#5065)
* Broadlink fix

* style fix

* style fix

* typo

* restructure

* Update broadlink.py

* Update broadlink.py

* Add support for more devices

* fix library version

* fix library version

* fix library version

* fix library version

* fix library version

* Update broadlink.py

* lib version

* remove lower

* remove lower

* refactor

* refactor

* refactor

* authorization

* authorization

* refactor

* lib version

* lib version
2017-01-03 23:45:11 +01:00
John Arild Berentsen 9c6a985c56 [zwave]Use schedule_ha_state and add debug message (#5143)
* Use schedule_ha_state and add debug message

* Logger not defined
2017-01-02 18:55:56 +01:00
Pascal Vizeli 9a16054867 Bugfix create a task from a task in component update (#5033) 2016-12-21 15:11:14 +01:00
Daniel Høyer Iversen 133c03ee57 style fix 2016-12-20 21:16:18 +01:00
Daniel Høyer Iversen f224ee7229 Solve some bugs in the bradlink switch 2016-12-20 21:05:54 +01:00
Daniel Høyer Iversen 00b80d4fe1 Support for broadlink sp (#4961)
* initial support for broadlink sp

* style fix

* style

* bug fix
2016-12-18 17:59:08 -08:00
Georgi Kirichkov 7390f82e1f Updates TP-Link dependency (#4914)
* Updates TP-Link switches dependent module

Refactors code to use the new module API

* Set TP-Link Switch name from the device settings

If no name has been set in the configuration file the name set on the device will be used

* Removes default name for TP-Link switch

Fallback to device alias now works properly

* Removes logging

* Updates comment to denote support for HS200 switch
2016-12-17 13:49:43 -08:00
Daniel Høyer Iversen 394d53e748 Broadlink sensor and switch (#4834)
* Broadlink sensor and switch

* broadlink logging

* Use async

* style

* style
2016-12-15 21:42:00 -08:00
Erik Eriksson 570cfc60c5 bugfix: is_on is a property (#4889) 2016-12-13 22:58:43 -08:00
Pascal Vizeli e4b6395250 Migrate REST switch to async (#4517)
* Migrate REST switch to async

* Update rest.py

* Address comments from paulus
2016-12-13 08:55:13 -08:00
Erik Eriksson 2a7fa5afc3 Telldus Live: (#4645)
- Implemented support for covers and dimmable lights.
- Removed global object, use hass.data.
- Disabled polling via update.
- Inherit from common TelldusLiveEntity device.
- Configurable polling interval
- Use https API endpoint
- Use tellduslive package
2016-12-11 21:39:37 -08:00
David-Leon Pohl 48928d1f9e Fix config validation (#4853) (#4854) 2016-12-11 17:38:33 -08:00
Jan Losinski f78246e686 Pilight receive match fix for bug 4637 (#4639)
* Pilight: dont protocol as list in COMMAND_SCHEMA

As described in bug #4637 the protocol should not be wrapped in a list
in the spec of COMMAND_SCHEMA because this causes the component to
never successfully match any received rf code.

As pointed ot in PR #4639 the easiest way to do this, is to not derive
COMMAND_SCHEMA from RF_CODE_SCHEMA and specify protocol as simple
string there.

This fixes bug #4637.

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>

* Pilight: Add "unitcode" to command schema.

This adds "unitcode" to the COMMAND_SCHEMA. It is used for example in
the brennenstuhl protocol of pilight.

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
2016-12-08 23:19:14 -08:00
Paulus Schoutsen 98fe50d5ad Update after service calls (#4795)
* Update after service calls

* Service update: wrap async_update in create_task
2016-12-06 22:30:47 -08:00
dasos a11b68c560 Fix connection check (#4732)
* Fix connection check

* Release instead

* Remove if

* Update hook.py
2016-12-05 21:37:05 -08:00
rubund e21382cd3e Fix broken EnOcean support (#4710)
* ensure_list

* CONF_ID is not required configuration for enocean lights

* Use vol.All(cv.ensure_list, [vol.Coerce(int)]) as suggested in pull request review

* Fix line too long
2016-12-05 08:15:36 -08:00
hexa- c8c6bee539 Revert "Update reference to correct tplink switch" (#4722) 2016-12-04 09:50:43 -08:00
DaveSergeant 4d35f2805f New support Digital Loggers relays (#4684)
* initial commit

Previous work included with no history.  Sorry, I was figuring out how to use git, branches and deal with open source projects.  At this point this is a working switch but with the shortcomings of each of the 8 ports causes a network query.  This needs to be rewritten so that the SwitchDevice is part of a larger device group that is only queried once, saving traffic and preventing the small device from timing out.

* Device polls independent of switches now

Used anel_pwrctrl.py as a basis to extract the per-switch polling out to per-device so it can be trottled properly.  Likewise, no longer touching the device independently for relay status AND relay name.  Getting them both from the same statuslist() return.

* Final comments and tweaks

Lowered cycle and update time since the device update is working so well now.  Effectively no timeouts anymore.

* Added dlipower to requirements

homeassistant.components.switch.digitalloggers

* Tox fixes

pydocstyle updates

* More tox errors

* Yet more tox

Removed useful future TODO and helpful details on the structure of the statuslocal list.
Good catch on not initializing .update(), though it worked.

* Blank line fix

* Added file to .coveragerc
2016-12-03 23:40:22 -08:00
Magnus Ihse Bursie 97cc76b43e Remove global variable from tellstick code (#4700)
* Refactor tellstick code for increased readability. Especially highlight if "device" is a telldus core device or a HA entity.

* Refactor Tellstick object model for increased clarity.

* Update comments. Unify better with sensors. Fix typo bug. Add debug logging.

* Refactor tellstick code for increased readability. Especially highlight if "device" is a telldus core device or a HA entity.

* Refactor Tellstick object model for increased clarity.

* Update comments. Unify better with sensors. Fix typo bug. Add debug logging.

* Fix lint issues.

* Remove global variable according to hint from balloob.
2016-12-03 17:27:55 -08:00
GadgetReactor 9a6c9cff30 Update reference to correct tplink switch (#4670) 2016-12-03 11:38:14 -08:00
William Scanlon 4c03d670c1 Wink PubNub v4 (#4561)
* PubNub v4

* Updated to pubnubsub-handler 0.0.5

* Updated requirements_all.txt
2016-11-30 13:12:26 -08:00
Paulus Schoutsen e5504b39ec Close aiohttp responses (#4624)
* Close aiohttp responses

* Update generic.py
2016-11-30 13:05:58 -08:00
Martin Hjelmare 71da9d2f50 Fix mysensors ir switch overwriting devices (#4612) 2016-11-30 13:02:18 -08:00
Pascal Vizeli 17f0fb69bd Homematic update with HomematicIP/HomematicWired support and multible… (#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
2016-11-29 20:53:02 +01:00
Christian Brædstrup 6ddbb4d568 Improved exception handling for D-Link switch (#4633) 2016-11-29 08:40:51 -08:00
Pascal Vizeli cf57db919e Refactory aiohttp clientsession handling in HA (#4602)
* Refactory aiohttp clientsession handling in HA

* remove from core / update platforms / rename file
2016-11-27 16:26:46 -08:00
Paulus Schoutsen 03e0c7c71c Prevent edimax from doing I/O in event loop (#4584) 2016-11-26 10:10:29 -08:00
Paulus Schoutsen 32ffd006fa Reorganize HTTP component (#4575)
* Move HTTP to own folder

* Break HTTP into middlewares

* Lint

* Split tests per middleware

* Clean up HTTP tests

* Make HomeAssistantViews more stateless

* Lint

* Make HTTP setup async
2016-11-25 13:04:06 -08:00
Fabian Affolter 475c412ae4 Minor changes (switch.hook) (#4553)
* Use string formatting, add link to docs, and pylint

* Extent platform for validation
2016-11-24 00:21:48 +01:00
dasos 5013a82655 Hook Smart Home support (#4392)
* Support for Hook (hooksmarthome.com)

* Linting

* Add asyncio

* Move to aiohttp

* Yield more
2016-11-23 14:52:14 +00:00
Magnus Ihse Bursie 1d8a1df2c4 Refactor tellstick code (#4460)
* Refactor tellstick code for increased readability. Especially highlight if "device" is a telldus core device or a HA entity.

* Refactor Tellstick object model for increased clarity.

* Update comments. Unify better with sensors. Fix typo bug. Add debug logging.

* Refactor tellstick code for increased readability. Especially highlight if "device" is a telldus core device or a HA entity.

* Refactor Tellstick object model for increased clarity.

* Update comments. Unify better with sensors. Fix typo bug. Add debug logging.

* Fix lint issues.
2016-11-22 21:48:22 -08:00
John Arild Berentsen 248f5c0209 Neato Fixes (#4490)
* Fix, switch state. Move constants to hub

* Responsiveness

* Whitespace

* Delay was not needed as commands does not return until done.
2016-11-21 19:36:44 -08:00
hexa- a73fbbaf7a switch.tplink: expect daily stats to be empty (#4504)
Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
2016-11-21 19:34:48 -08:00
John Arild Berentsen 8beefcfc69 Switch did not update (#4466) 2016-11-19 15:52:42 +01:00
John Arild Berentsen 679d500e61 Neato refactor and support for sensors (#4319)
* Imporvements to neato

* Review changes
2016-11-19 00:14:40 -08:00
Paulus Schoutsen 0f59bb208c Migrate callbacks to use schedule_update_ha_state (#4426)
* Migrate callbacks to use schedule_update_ha_state

* Migrate MQTT sensor callback to async

* Migrate wemo to not update inside schedule_update_ha_state

* Make MQTT switch async

* Fix nx584 test

* Migrate tellstick callback

* Migrate vera callback

* Alarm control panel - manual: use async callbacks

* Run the switch rest tests that work
2016-11-17 07:34:46 -08:00
Lewis Juggins a862bc4edc Fix DLink async I/O (#4301) 2016-11-16 18:55:58 -08:00
Paulus Schoutsen f006b00dc1 Fix spelling schedule_update_ha_state (#4415) 2016-11-16 08:26:29 -08:00
Pascal Vizeli 41aaeb715a Convert switch to AsnycIO (#4382)
* Convert switch to AsnycIO

* Move update entity to service

* use time better for faster handling

* Change to suggestion from paulus

* Use new shedule_update_ha_state

* fix lint

* minimize executor calls
2016-11-15 21:06:50 -08:00
Nathan Henrie 2109b7a1b9 Use entity_id for backend, friendly name for frontend (#4343)
* Use entity_id for backend, friendly name for frontend

Closes https://github.com/home-assistant/home-assistant/issues/3434

Command line switches had the option to set a `friendly_name` reportedly
for use in the front end. However, if set, it was also being used as the
`entity_id`.

This did not seem like obvious behavior to me. This PR changes the
behavior so the entity_id is the object_id, which must already be
unique, and is an obvious place to have a very predictable slug (even if
long or unsightly), and the friendly name (if set) is used for the
display.

Example:

```yaml
switch:
  platform: command_line
  switches:
    rf_kitchen_light_one:
      command_on: switch_command on kitchen
      command_off: switch_command off kitchen
      command_state: query_command kitchen
      value_template: '{{ value == "online" }}'
      friendly_name: "Beautiful bright kitchen light!"
```

If you were using in an automation or from dev tools, would use:
`switch.rf_kitchen_light_one`, but your front end would still show `Beautiful
bright kitchen light!`

* Add new arg to test_assumed_state_should_be_true_if_command_state_is_false

* Import ENTITY_ID _FORMAT from existing, rename device_name to object_id

* Rename `device_name` to `object_id`

* Test that `entity_id` and `name` are set as expected
2016-11-12 22:46:23 -08:00
Christian Brædstrup 17cfcc981d D-Link switch version bump of external library (#4351) 2016-11-11 17:38:12 +01:00
Javier González Calleja 20af5cb5b4 Daily consumption information for HS110 (#4206)
* Add daily consumption information for HS110

* Fixing code review

* Fixing code review

* Fixing code review
2016-11-10 22:43:16 -08:00
Pascal Vizeli 749fc583ea Fix rest switch default template (#4331) 2016-11-10 21:32:08 -08:00
Jan Losinski 7d2ab4fce6 Change pilight systemcode validation to integer (#4286)
* Change pilight systemcode validation to integer

According to the pilight code the systemcode should be an integer and
not a string (it is an int in the pilight code). Passing this as a
string caused errors from pilight:
"ERROR: elro_800_switch: insufficient number of arguments"

This fixes #4282

* Change pilight unit-id to positive integer

According to the pilight code the unit of an entity is also evrywhere
handled as an integer. So converting and passing this as string causes
pilight not to work.

This fixes #4282

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
2016-11-10 13:14:40 -08:00
Christopher Viel d404ac8978 Add support for off script to WOL switch (#4258) 2016-11-09 08:44:30 -08:00
sustah 8cbb8f6527 Update dlink.py (#4317)
corrected "total consumption" units from W to kWh
2016-11-08 19:58:27 -08:00
Pascal Vizeli 2e0c185740 Async cleanup part 3 (#4302) 2016-11-07 22:31:40 -08:00
David-Leon Pohl 67336a111b Hotfix #4272 (#4273) 2016-11-06 23:34:32 -08:00
Martin Hjelmare 734bd75fd3 Fix mysensors overwriting gateway in GATEWAYS (#4013)
GATEWAYS was a dict, so would overwrite item if key was the same. This
would happen when using multiple MQTT gateways, since the device id is
the same (`mqtt`).

* Fix by changing GATEWAYS from dict into list.
* Use hass data to store mysensors gateways instead of having GATEWAYS
  be a global.
2016-11-06 10:49:43 -08:00
Pascal Vizeli 382ac5c3b5 Async cleanups with new handling and executor (#4234) 2016-11-06 01:01:03 +01:00
Fabian Affolter 61a0976752 Use port instead of url and fix PEP257 issues (#4192) 2016-11-03 18:43:42 -07:00
Paulus Schoutsen ee5f228309 Make services yield (#4187)
* Make services yield

* Disable pylint abstract-method check

* add input_select

* add input_slider

* change to async vers.

* fix lint

* yield on add_entities as other components does
2016-11-03 18:32:14 -07:00
Georgi Kirichkov e4a713207d Fixes in TP-Link Switch logging 0 values on init (#4026)
* Fixes in TP-Link Switch logging 0 values on init

On init of component the emeter would log to influxdb and possibly other inputs a 0 value, instead of not logging anything.
Initial polling should circumvent that behavior and avoid logging inconsistencies.

* Refactors update call in __init__
2016-11-02 12:23:43 -07:00
Jon Caruana ba13951fff Add LiteJet (a lighting control system) component (#4125)
* Initial submission of LiteJet integration.

* Add LiteJet switch pressed automation trigger. (State changes are too slow to catch a press-release.)
Add LiteJet scene, replacing commented out code that treated these as lights.
Include LiteJet numbers in the device state so that it is easy to lookup entity -> number.

* Fix missing global.

* Allow light's brightness to be set explicitly.

* Support optional 'ignore' key to ignore prefixes of loads, switches, and scenes that weren't configured for use in the LiteJet system.

* Fix lint errors and warnings.

* Cleanup header comments.
Default to not creating LiteJet switches as these are generally not useful.

* Lint fixes.

* Fixes from pull request feedback.

* Use hass.data instead of globals for data storage.

* Fix lint warnings.
2016-11-01 20:44:25 -07:00
Fabian Affolter 4484a7a94b Use voluptuous for Pilight switch (#3819)
* Migrate to voluptuous

* Add protocol

* Update
2016-10-31 13:18:47 +01:00
Fabian Affolter be272ac64a Disable too-many-* (#4107)
* Disable too-many-* and too-few-public-methods

* Remove globally disabled pylint warnings
2016-10-30 22:18:53 +01:00
Fabian Affolter 9f2aae1357 Maintenance 2nd (#4106)
* Add link to docs

* Fix link

* Update line breaks

* Update ordering

* Align vera platofrm to only use add_devices
(instead od add_devices_callback)

* Remove line break

* Use consts

* Update ordering

* Update ordering

* Use const, create default name, use string formatting

* Update ordering

* Use const

* Update import style

* Update ordering and line breaks

* update line breaks

* Set default port

* Set defaults and update ordering

* Update ordering

* Minor style updates

* Update ordering, defaults, line breaks, and readability

* Use constants

* Add line breaks

* use string formatting

* Update line breaks

* Update logger
2016-10-30 09:58:34 +01:00
Pascal Vizeli 9c0455e3dc Allow update entities on add_entities callback (#4114)
* Allow udpate entities on add_entities callback

* fix wrong position

* update force_update to update_before_add

* add unittest for update_befor_add

* fix unittest

* change mocking
2016-10-29 15:33:11 -07:00
Fabian Affolter 942d630762 Maintenance zoneminder (#4102)
* Add timeout to requests, fix typos, and defaults

* Clean-up
2016-10-29 13:10:42 -07:00
Abhishek Anand 65bd7d2326 Generalized REST switch to enable templating and configurable timeout. (#3329)
* successfully tested the "remote temperature mode" switch for the radio thermostat

* removed logging and interpreted None as Off.

* turn_off value is also templated now -- can depend on state

Also, undid accidental removal of error logging.

* ensured backward compatibility of config file

if value_template is not provided, the update function behaves as before

* ran autopep8 --in-place

* fixed another complaint of tox

* addressed the comments of balloob

* undid acccidental log.error to log.info

* timeout : 50 -> 10

* added a timeout parameter

* removed the stray '-', better names for the failure case

* string comparisons after .lower(), as suggested by balloob

* addressed balloob's latest requests

* making flake happy

* value_template --> is_on_template in config file

* moved CONF_IS_ON_TEMPLATE to local file

* null checks

* addressed flake error

* properly comparing template text when is_on is not a template.
2016-10-27 22:34:22 -07:00
Matthew Treinish 0ff500ca25 Add mochad component (#3970)
This commit adds a new component for communicating with mochad[1] a
socket interface for the CM15A and CM19A USB X10 controllers. This
commit leverages the pymochad library to interface with a mochad socket
either on a local or remote machine. Mochad is added as as a generic
platform because it supports multiple different classes of device,
however in this patch only the switch device implemented as a starting
point. Future patches will include other devices types. (although
that's dependent on someone gaining access to those)

[1] https://sourceforge.net/projects/mochad/
2016-10-24 21:49:49 -07:00
Paulus Schoutsen 519d9f2fd0 async HTTP component (#3914)
* Migrate WSGI to asyncio

* Rename wsgi -> http

* Python 3.4 compat

* Move linting to Python 3.4

* lint

* Lint

* Fix Python 3.4 mock_open + binary data

* Surpress logging aiohttp.access

* Spelling

* Sending files is a coroutine

* More callback annotations and naming fixes

* Fix ios
2016-10-23 23:48:01 -07:00
Georgi Kirichkov 4f6ed09a99 Adds energy monitoring capabilities to the TP-Link HS110 (#3917)
* Adds energy monitoring capabilities to the TP-Link HS110

Energy monitoring works only on the HS110 model

* Reverts to using GadgetReactor's module

* Updates requirements_all.txt

* Refactors tplink switch to use attribute caching

* Update tplink.py
2016-10-21 21:45:36 -07:00
Hugo Dupras cb47507002 Add support for Neato Connected robot as a switch (#3935)
* Add support for Neato Connected robot as a switch

Signed-off-by: Hugo D. (jabesq) <jabesq@gmail.com>

* Add checklist items

Signed-off-by: Hugo D. (jabesq) <jabesq@gmail.com>

* Add missing docstring

Signed-off-by: Hugo D. (jabesq) <jabesq@gmail.com>

* [Neato] Add update function to retrieve robot state

* Add docstring for update function + catch exception when retrieving state

* Change type of HTTPError when updating state

* Fix pylint errors
2016-10-21 21:14:45 -07:00
Pascal Vizeli 754e93ff6a Rename add_devices to async_add_devices like dev guide (#3938) 2016-10-19 00:35:22 +02:00
Pascal Vizeli 14ef0ca786 Bugfix Template sensors (#3931) 2016-10-18 07:27:32 +02:00
William Scanlon c54476b62f Protocol is an int (#3928) 2016-10-17 19:53:50 -07:00
Pascal Vizeli 1540bb1279 Async template (#3909)
* port binary_sensor/template

* port sensor/template

* port switch/template

* fix unittest

* fix

* use task instead yield on it

* fix unittest

* fix unittest v2

* fix invalid config

* fix lint

* fix unuset import
2016-10-17 07:00:55 +02:00
Per Sandström d9ae7ceb0c Tellstick switch force update (#3874) 2016-10-16 15:56:55 -07:00
Richard Cox 1cbf8c8049 Zoneminder component (#3795)
* Initial Zoneminder commit

* Fixing bug when ZM sets its function to 'None'

* Adding zoneminder to coverage

* Quick Doc fix

* Update zoneminder.py

Doc Fix

* making the url base optional
2016-10-14 20:56:40 -07:00
Fabian Affolter e135691bd6 Migrate to voluptuous (#3817) 2016-10-11 08:33:22 -07:00
Fabian Affolter a99f36f519 Migrate to voluptuous (#3737) 2016-10-11 00:56:57 -07:00
Robbie Trencheny f37038921f Fix E501 line too long error 2016-10-07 11:48:38 -07:00
Robbie Trencheny f030ff67ad Set anel_pwrctrl switch to specific commit instead of master 2016-10-07 11:38:39 -07:00
Robbie Trencheny 3cfec2b5e2 Set TP-Link switch to specific commit instead of master 2016-10-07 11:36:43 -07:00
Paulus Schoutsen 5085cdb0f7 Add async_safe annotation (#3688)
* Add async_safe annotation

* More async_run_job

* coroutine -> async_save

* Lint

* Rename async_safe -> callback

* Add tests to core for different job types

* Add one more test with different type of callbacks

* Fix typing signature for callback methods

* Fix callback service executed method

* Fix method signatures for callback
2016-10-04 20:44:32 -07:00