Commit graph

1357 commits

Author SHA1 Message Date
Anders Melchiorsen
9e16be3173 LIFX: clean up internal color conversions ()
* Add color_util.color_hsv_to_RGB

* Use helper functions for LIFX conversions

The LIFX API uses 16 bits for saturation/brightness while HA uses 8 bits.
Using helper functions makes the conversion a bit nicer and less prone
to off-by-one issues.

The colorsys library uses 0.0-1.0 but we can avoid that by using the HA
color_util converters instead.
2017-06-11 21:19:58 +02:00
Thiago Oliveira
ba80d5e52a test that all lights turn off when no entity id is given () 2017-06-10 10:13:52 +02:00
Paulus Schoutsen
db0efc647d New component: Python Script ()
* Add initial version

* Fix requirements

* Prefer logging over printing

* Set executor thread name on >Py36 only

* Add tests

* Lint

* Add restrictedpython to test dependencies

* Create python_script.py

From doc:
```
However, an empty dict ({}) is treated as is. If you want to specify a list that can contain anything, specify it as dict:
>>> schema = Schema({}, extra=ALLOW_EXTRA)  # don't do this
>>> try:
...   schema({'extra': 1})
...   raise AssertionError('MultipleInvalid not raised')
... except MultipleInvalid as e:
...   exc = e
>>> str(exc) == "not a valid value"
True
>>> schema({})
{}
>>> schema = Schema(dict)  # do this instead
>>> schema({})
{}
>>> schema({'extra': 1})
{'extra': 1}

```
2017-06-09 12:38:40 +02:00
Jacob Minnis
bb6fe822f9 Added 'change' field to statistics sensor ()
* Added 'change' field to statistics sensor

* Updated statistics sensor test

* Updated statistics sensor test complaint
2017-06-07 09:38:00 +02:00
Fabian Affolter
12f731b32c Fix docstring () 2017-06-05 13:16:53 +02:00
PhracturedBlue
11dcbd4449 Add 'icon_template' to switch templates (similar to sensor template) ()
* Add 'icon_template' to switch templates (similar to sensor template)

* Add test for template switch 'icon_template'
2017-06-05 11:27:48 +02:00
Martin Berg
b90964faad Add support for Vanderbilt SPC alarm panels and attached sensors ()
* Add support for Vanderbilt SPC alarm panels.

 * Arm/disarm + read state

 * Autodiscover and add motion sensors

* Fix code formatting.

* Use asyncio.async for Python < 3.4.4.

* Fix for moved aiohttp exceptions.

* Add docstrings.

* Fix tests and add docstrings.
2017-06-04 23:53:25 -07:00
Trevor
2e27c0d5ec Add Radarr sensor ()
* Add radarr.py

* Update radarr.py

* Update radarr.py

* Add test_radarr.py

* Update test_radarr.py

* Update test_radarr.py

* Update radarr.py

* Update .coveragerc

* Fix hound.
2017-06-04 23:44:24 -07:00
cribbstechnologies
774f584ba8 Mqtt cover modifications ()
* adding set position ability
removing command_topic being required

* flaking

* flaking test

* updating docs

* requested updates

* Revert "updating docs"

This reverts commit 9cfc5ed7a8.

* forgot to update constructor calls in tests
2017-06-04 22:55:06 -07:00
Per Osbäck
0646d01152 Add support for the expirationTime parameter. ()
Enabled by default in Chrome 60.
Only accepts the param, doesn't act on the actual expiration date. Chrome will always pass NULL for now.

https://github.com/w3c/push-api/pull/248
https://www.chromestatus.com/feature/4929396687241216
https://bugs.chromium.org/p/chromium/issues/detail?id=718837
2017-06-04 22:46:18 -07:00
Paulus Schoutsen
84fe4f75df Fix MQTT camera test () 2017-06-03 18:51:29 -07:00
Adam Mills
9c9f5068b7 Support for renaming ZWave values ()
* Support for renaming ZWave values

* Improve test
2017-06-02 23:03:00 -07:00
Paulus Schoutsen
7d4adbbef5 Fix html5 unsub ()
* Fix  subscription expiration/removal

Removes a subscription after receiving an HTTP 410 response when trying to send a new message.

* Fix tests failing due to additional call

* Fix code style

* Lint
2017-06-02 20:56:16 -07:00
Johan Bloemberg
d472d81538 Align switch group handling with light. () 2017-06-02 00:05:34 -07:00
Alex Harvey
78887c5d5c Start of migration framework, to allow moving of files in the config … ()
* Start of migration framework, to allow moving of files in the config directory to be hidden, ios.conf used as the first one to undergo this change.

* Update const.py

* Update test_config.py

* improvement to syntax
2017-06-01 23:50:04 -07:00
Anders Melchiorsen
e2cfdbff06 Disallow ambiguous color descriptors in the light.turn_on schema ()
* Disallow ambiguous color descriptors in the light.turn_on schema

* Update tests
2017-06-01 23:05:05 -07:00
Boris K
1b5f6aa1b9 Optimize history_stats efficiency and database usage () 2017-06-01 22:52:55 -07:00
Adam Mills
beb8c05d91 Use expected behvaior for above/below () 2017-06-01 22:43:24 -07:00
Adam Mills
cf42303afb Rename time trigger 'after' to 'at' () 2017-06-01 22:40:27 -07:00
Adam Mills
e0712ba329 Expose the node name on the zwave node entity () 2017-06-01 22:33:16 -07:00
Paulus Schoutsen
e68bd0457c Fix more deprecation warnings ()
* Remove setting up an hbmqtt broker

* Don't pass loop to web.Application in tests

* Use .query instead of deprecated .GET for aiohttp requests

* Fix closing file resource

* Do not use asyncio mark

* Notify.html5 - PyJWT: Use options to disable verify

* Yamaha: Test was still using deprecated ip

* Remove pytest-asyncio
2017-05-26 13:12:17 -07:00
Paulus Schoutsen
f43db3c615 Replace executor with async_add_job ()
* Remove executor

* Lint

* Lint

* Fix tests
2017-05-26 08:28:07 -07:00
Adam Mills
9e9705d6b2 Support for GE Zwave fan controller ()
* Support for GE Zwave fan controller

* Tests for zwave fan

* Add additional fan workarounds
2017-05-25 22:55:00 -07:00
Paulus Schoutsen
6899c7b6f7 assertEquals is deprecated () 2017-05-25 22:21:22 -07:00
Paulus Schoutsen
d0c9d6b69a Remove usage of event_loop fixture () 2017-05-25 21:40:36 -07:00
Paulus Schoutsen
81aaeaaf11 Get rid of mock http component app ()
* Remove mock_http_component from config tests

* Remove mock_http_component_app from emulated hue test
2017-05-25 21:13:53 -07:00
Adam Mills
65c3201fa6 Rename of the zwave hass.data constants ()
* Rename of the zwave hass.data constants

* Remove zwave since it is already implied
2017-05-25 21:11:02 -07:00
Anton Sarukhanov
3a843e1817 Add icons to device tracker. () 2017-05-24 19:12:26 -07:00
amigian74
775d45ae5a Exclude filter for event types ()
* add exclude filter for event types to recorder component

* corrected long line (279)

* change source code structure
add test for exclude event types

* code cleanup

* change source code structure

* Update __init__.py

* Update test_init.py
2017-05-24 15:23:52 -07:00
cribbstechnologies
ef4ef2d383 Template light ()
* starting light template component

* linting/flaking

* starting unit tests from copypasta

* working on unit testing

* forgot to commit the test

* wrapped up unit testing

* adding remote back

* updates post running tox

* Revert "adding remote back"

This reverts commit 852c87ff96.

* adding submodule back from origin

* updating submodule

* removing a line to commit

* re-adding line

* trying to update line endings

* trying to fix line endings

* trying a different approach

* making requested changes, need to fix tests

* flaking

* union rather than intersect; makes a big difference

* more tests passing, not sure why this one's failing

* got it working

* most of the requested changes

* hopefully done now

* sets; the more you know
2017-05-24 14:32:22 -04:00
everix1992
3638b21bcb Added new commands and functionality to the harmony remote component. ()
* Added new commands and functionality to the harmony remote component.

-This includes the ability to optionally specify a number of times to repeat a specific command, such as pressing the volume button multiple times.
-Also added a new command that allows you to send multiple commands to the harmony at once, such as sending a set of channel numbers.
-Updated the unit tests for these changes.

* Fix flake8 coding violations

* Remove send_commands command and make send_command handle a single or list of commands

* Remove send_commands tests

* Update itach and kira remotes for new send_command structure. Fix pyharmony version in requirements_all.txt

* Fix incorrect variable name

* Fix a couple minor issues with remote tests
2017-05-23 17:00:52 -07:00
Stu Gott
54c45f80c1 Fix time_date sensor to update at predictable intervals ()
* Fix time_date sensor to update at predictable intervals

* Delete automations.yaml
2017-05-23 16:00:26 -07:00
Anton Sarukhanov
7055fddfb4 Don't block startup more than 60 seconds while waiting for components. () 2017-05-23 14:29:27 -07:00
nordeep
be53cc7068 Don't initialize mqtt components which have already been discovered ()
* Don't initialize mqtt components which have already been discovered

* Fix string length

* Fix blank lines, fix constant name

* Remove globals. Remove JSON dump

* Add tests. Update grammar

* PEP8 style issue

* Add hyphen to object_id regex

* PEP8 style fix
2017-05-23 11:08:12 -07:00
Anton Sarukhanov
f3dabe21ab Prevent the random template filter from caching its output. Fixes () 2017-05-23 10:32:06 -07:00
Lev Aronsky
c556b619b7 Asuswrt continuous ssh ()
* Make ssh and telnet connections continuous in asuswrt

* Refactored SSH and Telnet connections into respective classes.

* Fixed several copy-paste typos and errors.

* More typos fixed.

* Small changes to arguments, to pass automated tests.

* Removed unsupported named arguments.

* Fixed a couple of mistakes in Telnet, and other lint errors.

* Added Telnet tests, and added lint exceptions.

* Removed comments from tests, as they irritated the hound.
2017-05-23 09:55:01 -07:00
Paulus Schoutsen
17cbe0c6ce Allow fetching hass.io panel without auth () 2017-05-22 11:00:02 -07:00
Anders Melchiorsen
bb8de5845a Sort entities in default groups by name ()
* Sort entities in default groups by name

* Cleanups from review
2017-05-21 17:05:48 -07:00
John Arild Berentsen
4a0d6e73f4 ZWave: Add reset service to meters ()
* Add reset service for command_class meters.

* Add reset service for command_class meters.

* cast index to const.py
2017-05-21 20:15:24 +02:00
Andrey
927024714b Zwave: Apply refresh_node workaround on 1st instance only ()
* Apply refresh_node workaround on 1st instance only

* Add another test
2017-05-21 17:33:42 +03:00
Anders Melchiorsen
81f0826550 Ignore attribute changes in automation trigger from/to ()
* Ignore attribute changes in automation trigger from/to

* Quote names in deprecation warnings

This makes it somewhat easier to read if the suggestion happens to be
named "to".

* Add test with same state, new attribute value
2017-05-20 15:18:59 -04:00
Paulus Schoutsen
d369d70ca5 Fix tests ()
* Remove global hass

* Http.auth test no longer spin up server

* Remove server usage from http.ban test

* Remove setupModule from test device_sun_light_trigger

* Update common.py
2017-05-19 07:37:39 -07:00
John Arild Berentsen
5aa72562a7 Bugfix () 2017-05-19 13:40:26 +02:00
John Arild Berentsen
88ffe39945 Final tweaks for Zwave panel ()
* # This is a combination of 3 commits.
# The first commit's message is:
Add seperate zwave panel

# The 2nd commit message will be skipped:

#	unused import

# The 3rd commit message will be skipped:

#	Use get for config

* Add seperate zwave panel

* Modify set_config_parameter to accept setting string values

* descriptions

* Tweaks

* Tweaks

* Tweaks

* Tweaks

* lint

* Fallback if no config parameteres are available

* Update services.yaml

* review changes
2017-05-18 17:39:31 -07:00
Paulus Schoutsen
e773133bcf Fix automation failing to setup if no automations specified () 2017-05-17 21:57:50 -07:00
Anders Melchiorsen
3d4b2436db Coerce color_temp to int even when passed in as kelvin () 2017-05-17 19:20:59 -07:00
Paulus Schoutsen
a068efcd47 Abort tests when instances leaked () 2017-05-18 00:19:40 +02:00
Anders Melchiorsen
ed5f94fd8a Add kelvin/brightness_pct alternatives to light.turn_on ()
* Refactor color profiles to a class

* Refactor into preprocess_turn_on_alternatives

* LIFX: use light.preprocess_turn_on_alternatives

This avoids the color_name duplication and gains support for profile.

* Add kelvin parameter to light.turn_on

* Add brightness_pct parameter to light.turn_on

* LIFX: accept brightness_pct in effects

* Add test of kelvin/brightness_pct conversions
2017-05-16 23:00:46 -07:00
Fabian Affolter
f25347d98d File sensor ()
* Add File sensor

* Use None and return

* Remove I/O

* Use less memory

* No traceback if file is empty
2017-05-15 14:25:46 +02:00
Marc Egli
4da91d6a8b Add sonos alarm clock update service ()
* Add sonos alarm clock update service

* Add tests and break lines

* Fix style errors

* Make test work with python<3.6

* Fix last two pylint errors

* fix new line to long errors
2017-05-15 00:42:45 -07:00