Commit Graph

304 Commits (23700e4db8d8ee613fa0a0cbb1b9f9294efdb532)

Author SHA1 Message Date
Johann Kellerman 85e3dfe6a6 Exclude secrets.yaml in yaml !include_directories (#2450) 2016-07-06 22:17:02 -07:00
Paulus Schoutsen bacc14d845 Merge pull request #2421 from armills/zwave-color-bulbs
Move Aeotec bulb color logic to Zwave workaround
2016-07-02 11:11:44 -07:00
Adam Mills 6477122b23 Move Aeotec bulb color logic to Zwave workaround
Default behavior for warm/cold white channels is to assume the white
channel is mixed with the rgb. This is a sane default and should support
the Fibaro RGBW LED controller.
2016-07-02 12:08:01 -04:00
Fabian Affolter 3870d2e0cd Docstring updates (#2404)
* Fix docstring

* Fix typo

* Update docstrings

* Update docstrings
2016-07-01 21:39:30 +02:00
Paulus Schoutsen 6714392e9c Move elevation to core config and clean up HTTP mocking in tests (#2378)
* Stick version numbers

* Move elevation to core config

* Migrate forecast test to requests-mock

* Migrate YR tests to requests-mock

* Add requests_mock to requirements_test.txt

* Move conf code from bootstrap to config

* More config fixes

* Fix some more issues

* Add test for set config and failing auto detect
2016-06-27 09:02:45 -07:00
Johann Kellerman 7b02dc434a Secrets support for configuration files (#2312)
* ! secret based on yaml.py

* Private Secrets Dict, removed cmdline, fixed log level

* Secrets limited to yaml only

* Add keyring & debug tests
2016-06-25 00:10:03 -07:00
mikebarris 5223d20668 Removed webcolors dependency in favor of dictionary lookup. (#2215)
* Removed webcolors dependency in favor of dictionary lookup.

* Fixed code style errors.

* Moved color dictionary to module per suggestion.

* Removed try/except per suggestion.
2016-06-08 22:25:32 -07:00
Fabian Affolter 4b0df51b40 Vendorize vincenty requirement (#2176) 2016-05-29 11:55:16 -07:00
Nolan Gilley 191fc8f8d4 Change color_RGB_to_xy formula & return brightness (#2095)
* Use RGB to XY calculations from Philips Hue developer site

* uppercase X,Y,Z

* rename cx,cy to x,y

* return brightness in color_RGB_to_xy

* remove try/catch

* update existing platforms using color_RGB_to_xy

* improve wemo w/ jaharkes suggestion

* allow brightness override of rgb_to_xy
2016-05-21 10:19:27 -07:00
happyleavesaoc 15f89fc636 add some include_dir options (#2074)
* add some include_dir options

* validate, and extend instead of add

* add yaml include tests
2016-05-17 15:47:44 -07:00
Robbie Trencheny a431277de1 Accept human readable color names to change light colors (#2075)
* Add support for providing color_name which accepts a CSS3 valid, human readable string such as red or blue

* Forgot the schema validation!

* ugh farcy

* use html5_parse_legacy_color for more input options

* Add webcolors==1.5 to setup.py

* Block pylint no-member errors on tuple

* add color_name_to_rgb test

* whoops

* revert changes to individual platforms

* If color_name is set, pop it off params and set rgb_color with it

* Forgot to reset wink.py

* Import the legacy function as color_name_to_rgb directly

* reset test_color.py

* Improve light services.yaml
2016-05-17 00:06:55 -07:00
Daniel Høyer Iversen 630b7377bd Refactor get_age in util/dt (#2067) 2016-05-14 12:05:46 -07:00
mnestor 954b56475e YAML: add !include_named_dir and ! include_list_dir (#2054)
* add include_dir constructor for yaml parsing

* changed to allow for flat and name based directory including

* fixed ci errors

* changed flat to list
2016-05-13 21:16:04 -07:00
Robbie Trencheny 16933abce9 Remove humanize and use a relative time thing that @balloob found on Github 2016-05-10 00:04:53 -07:00
Paulus Schoutsen e40908d67c Improve config validation error message 2016-05-07 22:31:22 -07:00
Paulus Schoutsen 6901e5ea5e Random fixes (#1996)
* OwnTracks handle malformed data better

Fixes #1991 .

* Remove dependency for util.dt
2016-05-07 10:16:14 -07:00
Charles Spirakis b86a1ece01 Allow conversion from date strings to "unix" timestamp. (#1985)
"unix" timestamp is number of seconds since Jan 1, 1970 UTC.
This allows scripts that use templates to generate time
deltas in seconds if desired from state attributes such
as last_updated.

Some examples:

timestamp now is
{{ as_timestamp(now) }}

timstamp of last change is
{{ as_timestamp(states.binary_sensor.garage_door.last_changed) }}

seconds since last change is
{{ as_timestamp(now) - as_timestamp(states.binary_sensor.garage_door.last_changed) }}
2016-05-06 18:33:46 -07:00
Fabian Affolter 72cf7fd9c2 Add timeout to request for location elevation (#1978) 2016-05-06 18:10:13 -07:00
Brent 34193de158 Update yaml parser for handling environment variables (#1967) 2016-05-03 18:41:14 -07:00
Paulus Schoutsen 2e79e9d5bb Correct celcius to celsius (#1860) 2016-04-19 20:30:44 -07:00
Brad Johnson 09693bf16c Upgrading to python-wink 0.7.4 and improving RGB color support in HA (#1832) 2016-04-17 19:07:21 -07:00
Paulus Schoutsen 68d92c3196 Use standardised datetime format 2016-04-16 01:46:50 -07:00
Jan Harkes 73859f59f0 Make yaml config parser errors look less like bugs. (#1776)
Instead of nested tracebacks, show a simpler error message.

    Config directory: /home/user/.homeassistant
    ERROR:homeassistant.util.yaml:duplicate key: "script"
      in "/home/user/.homeassistant/configuration.yaml", line 95, column 0
      in "/home/user/.homeassistant/configuration.yaml", line 108, column 0
2016-04-09 15:25:01 -07:00
Jan Harkes d6abdc0d4e Add line numbers when we find duplicate keys. (#1750) 2016-04-08 20:53:27 -07:00
Fabian Affolter 2e44166854 Change to freegeoip.io and add a second service as fall-back 2016-04-06 10:25:40 -07:00
Jan Harkes dbbbed404c Detect duplicate keys in configuration.yaml. 2016-04-05 21:21:16 -07:00
Paulus Schoutsen 13d7f742a7 Add thread names 2016-03-12 16:54:31 -08:00
Paulus Schoutsen b9856a2af5 Fix final pep257 issues 2016-03-09 23:34:38 -08:00
Fabian Affolter 876978d64a Fix PEP257 issues 2016-03-07 23:20:48 +01:00
Paulus Schoutsen 4e750a4d72 Merge pull request #1417 from fabaff/freegeoip
Catch 503 responses by freegeoip.net (Fixes #1378)
2016-02-27 16:12:47 -08:00
Fabian Affolter eb8228237e Catch connection issue with freegeoip.net (Fixes #1378) 2016-02-27 23:58:36 +01:00
Paulus Schoutsen bca4dee30e Merge pull request #1393 from persandstrom/throttle_fix
Throttle should work on a single method
2016-02-27 14:49:56 -08:00
Per Sandström 562db5ea4c Throttle for two methonds in same class 2016-02-27 23:18:56 +01:00
Fabian Affolter 213cc920d0 Move template to helpers 2016-02-23 21:19:10 +01:00
Paulus Schoutsen 3d8e9b4261 Lint fixes 2016-02-21 13:09:49 -08:00
Paulus Schoutsen 7c6dcdb082 Catch an extra error that could break util.convert 2016-02-21 11:23:16 -08:00
Paulus Schoutsen c3bb6d32aa Add closest template helper 2016-02-21 11:13:40 -08:00
Paulus Schoutsen 9f5f13644a Add template multiply test 2016-02-21 11:12:37 -08:00
Paulus Schoutsen 7805d2800c Expose current time object instead of method to retrieve (thanks @fabaff) 2016-02-21 09:32:43 -08:00
Paulus Schoutsen 9ad2cf7b7a Adjust template rounding tests 2016-02-20 21:59:16 -08:00
Paulus Schoutsen 6ac54b20c7 Add template distance helper 2016-02-20 21:58:53 -08:00
Paulus Schoutsen 6847dac582 Expose current time in templates
Fixes #1282
2016-02-20 20:58:01 -08:00
Paulus Schoutsen e80309c03c Fix imports (using isort) 2016-02-18 21:27:50 -08:00
MartinHjelmare 6e8c79d531 Change refactor structure
* Make a flatter one level inheritance, with MySensorsLight as parent
	with four children, one per light type.
* Break out helper methods. One per plain light, dimmer and RGB/RGBW
	children and per update, turn_on and turn_off, nine in total. Put
	these in the parent.
* Call the helper methods as needed from the child methods update,
	turn_on and turn_off.
* Change name of MySensorsLightLight to MySensorsLightPlain.
* Fix module docstrings according to pep257.
* Change name of color util method from rgb_hex_to_list to
	rgb_hex_to_rgb_list.
* Add unit tests for rgb_hex_to_rgb_list.
2016-02-18 02:04:06 +01:00
MartinHjelmare 03423cc3a9 Refactor mysensors light
* Add a light entity class per V_LIGHT, V_DIMMER, V_RGB and V_RGBW.
    Make these classes inherit each other up to MySensorsLight class.
* Map the entity classes to their S_TYPE in a dict.
* Check if an entity class map or just an entity class have been passed
    to pf_callback_factory before using the entity_class variable in
    homeassistant/components/mysensors.py.
* Add rgb_hex_to_list function in homeassistant/util/color.py.
2016-02-18 02:04:06 +01:00
Paulus Schoutsen 68803a46b6 Thread pool tweaks 2016-02-14 23:01:49 -08:00
Paulus Schoutsen b0948bef5f Make State class immutable 2016-02-09 23:27:01 -08:00
Ryan Kraus 7a00bf8696 Fixed time zone conversion with no TZ specified
Using .replace to set the current time zone appears to not handle
things correctly. The proper way to do this is apparently .localize.
2016-02-06 21:31:07 -05:00
Paulus Schoutsen a5db23afa4 Mock util.location by default 2016-02-04 22:26:02 -08:00
Paulus Schoutsen a0f6f3ac22 Merge pull request #1085 from molobrakos/yaml_safe_load
use yaml safe loader
2016-02-01 08:15:32 -08:00
Paulus Schoutsen 0b8e097705 Remove unused environment util 2016-01-31 08:58:30 -08:00
Erik 4b253d17ba use yaml safe loader 2016-01-31 00:46:08 +01:00
Paulus Schoutsen ef132e4583 Add tests for color util 2016-01-29 18:44:21 -08:00
Fabian Affolter 7aba78f96e Update docstrings 2016-01-27 00:08:06 +01:00
Paulus Schoutsen bc19ef66bf Move split_entity_id to helpers 2016-01-23 22:49:49 -08:00
Paulus Schoutsen de08f0afaa Load YAML config into an ordered dict 2016-01-23 22:41:01 -08:00
Andrew Thigpen 11f32d0500 Add is_state_attr method.
Returns True if the entity exists and has an attribute with the given
name and value.
2015-12-31 14:58:18 -06:00
Paulus Schoutsen 586be7fad1 Prevent division by 0 xy->rgb color conversion 2015-12-29 00:09:38 -08:00
Paulus Schoutsen ab5a3f9de3 Clean up YR sensor 2015-12-27 11:07:25 -08:00
Paulus Schoutsen f73f824e0e Make template states var callable 2015-12-12 22:19:37 -08:00
Paulus Schoutsen 360b99be59 Add template is_state method 2015-12-12 22:19:12 -08:00
Paulus Schoutsen 2b975c8620 Add flexible error value for value template parsing 2015-12-12 10:35:15 -08:00
Paulus Schoutsen b1bf6a609e Catch exceptions when error rendering templates 2015-12-11 19:07:03 -08:00
Paulus Schoutsen 5c63862054 Fix template rounding 2015-12-11 18:45:53 -08:00
Paulus Schoutsen d55fda28c2 Add value renderer helper method 2015-12-10 21:38:35 -08:00
Paulus Schoutsen 7acef84aad Add variable support to template rendering 2015-12-10 21:16:05 -08:00
Paulus Schoutsen 0dcc69d800 Fix template rounding 2015-12-10 20:47:06 -08:00
Paulus Schoutsen af09a305cf Add multiply template filter 2015-12-10 20:47:06 -08:00
Paulus Schoutsen de68d3355a Add template support 2015-12-10 20:47:05 -08:00
Paulus Schoutsen a301d869d7 PyLint 1.5 fixes 2015-11-29 13:49:05 -08:00
Paulus Schoutsen 6135b87b1d Log error if unable to install package 2015-11-15 02:05:13 -08:00
Paulus Schoutsen 4fb301b7a9 Check global installed packages 2015-11-08 22:55:22 -08:00
MakeMeASandwich e3304caf06 add hyperion light support 2015-10-17 19:36:52 +02:00
Paulus Schoutsen b05f2e3221 Fix style issue 2015-10-11 11:04:16 -07:00
Paulus Schoutsen dcfc91e71c Fix throttle applied to methods 2015-10-11 10:42:42 -07:00
Paulus Schoutsen 47fc1deecb Fix throttle to work on instance-level 2015-10-08 23:49:55 -07:00
Paulus Schoutsen 9bdfa89b7c More robust geofence checking 2015-10-02 08:16:53 -07:00
Paulus Schoutsen 2eb36c18bd Add geofencing to automation 2015-09-29 00:18:52 -07:00
Paulus Schoutsen 30492cc685 Fix tests and linting 2015-09-20 11:46:01 -07:00
Paulus Schoutsen 19d40612e6 Add home_range to device tracker 2015-09-20 09:35:03 -07:00
Paulus Schoutsen 4ad4d74ed4 Fix pip not detecting package installed 2015-09-16 23:18:47 -07:00
Paulus Schoutsen 86aea83f64 Device tracker improvements 2015-09-15 23:35:28 -07:00
Paulus Schoutsen c18294ee76 Allow triggers to be used as condition 2015-09-15 08:56:06 -07:00
Paulus Schoutsen cfc23b0091 Speed up tests 2015-09-12 22:56:49 -07:00
Paulus Schoutsen f9b17ab026 Device tracker rewrite 2015-09-09 23:37:15 -07:00
Paulus Schoutsen 326d23de38 Fix pip checking if zip files are installed 2015-09-08 19:49:27 -07:00
Ryan Kraus a097e9caf2 Reverted a line in package.py to its previous state. 2015-09-05 04:53:44 -04:00
Ryan Kraus 34c4bb585a Fix pip installation issues.
This commit is to fix issue #325.
There were three issues with the PIP installations.

1) If multiple instances of the same platform were found, pip could
attempt to install the same dependency multiple times at once by being
run simultaneously in different processes. This would cause pip
failures due to race conditions. This has been fixed by using a thread
lock to allow only one instance of PIP to run at a time.

2) PIP would not check the target if the dependency was already met.
This would lead to PIP attempting to reinstall every dependency on
every boot. This would eventually fail because the package was already
installed, but it significantly increased boot time, especially on
Raspberry Pis.

3) PIP would not upgrade packages that were already installed. Usually,
when a version is specified to PIP, it will install the specified
version if it is not already installed, even without the \-\-upgrade
flag. This behavior did not work when using the \-\-target flag. When
using the target flag, a new install is always attempted, but nothing
will be overwritten unless the \-\-upgrade flag is also given. This
caused new packages to not be installed when their dependencies were
increased. This is fixed by defaulting towards using the
\-\-upgrade flag.
2015-09-05 04:50:35 -04:00
Paulus Schoutsen a20ab24ba5 Remove unused pip constant 2015-08-29 23:08:33 -07:00
Ryan Kraus 4e01e7ca9b Pip requirements and fixes.
1) Reduced the flags being sent to pip.
2) Required a minimum of pip 7.0.0 for Home Assistant.
2015-08-29 23:17:47 -04:00
Ryan Kraus 6fdf9b8d7c Many changes to cleanup config directory and lib installations.
Cleaned up default config directory determination.
Made bootstrap creators for HA always set config directory.
Made bootstrap creators set the local library in the Python Path.
Moved all exceptions to their own file to make imports easier.
Moved default configuration directory be in the users’ profile.
Moved pip installs to be done to a lib folder in the config directory.
Reduced requirements.txt to only the barebones reqs.
2015-08-29 21:11:24 -04:00
Paulus Schoutsen 086961d109 Add temperature util, helpers 2015-08-16 22:06:01 -07:00
Paulus Schoutsen b61b3c611d Extract temperature util 2015-08-16 21:36:33 -07:00
Paulus Schoutsen d2b5f429fe Remove deprecated code 2015-08-04 16:21:09 -04:00
Paulus Schoutsen 7870e9a5e2 Minor cleanup core 2015-08-03 17:05:33 +02:00
Paulus Schoutsen c532a28a98 Increase robustness dependency installation 2015-07-15 18:37:24 -07:00
Paulus Schoutsen dea0fcc845 Improve virtual env detection 2015-07-11 00:02:42 -07:00
Paulus Schoutsen 2b23eec0f7 Fix pip 1.5.4 compatibility 2015-07-10 21:24:28 -07:00
Paulus Schoutsen aeae7c2c02 Reorganize util methods 2015-07-07 00:01:17 -07:00
Paulus Schoutsen b346f6e8ad Allow installing component dependencies on the fly 2015-07-07 00:00:21 -07:00
Paulus Schoutsen 8a14f46595 Add support to logbook component to browse days 2015-06-14 22:56:55 -07:00
Fabian Affolter 5266e10140 add new methods for date/time output 2015-05-08 17:00:12 +02:00
Paulus Schoutsen 3720333927 UTC bugfixes 2015-04-28 22:38:43 -07:00
Paulus Schoutsen e0ecb64a10 Use UTC as the internal datetime format 2015-04-28 19:12:05 -07:00