9 Commits

Author SHA1 Message Date
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
Fabian Affolter
5f508b6afa Use voluptuous for REST platforms (#2887)
* Initial step to migrate to voluptuous

* Migrate to voluptuous

* Add schema for sensor_classes
2016-08-20 16:28:45 -07:00
Paulus Schoutsen
b9856a2af5 Fix final pep257 issues 2016-03-09 23:34:38 -08:00
Fabian Affolter
49ebc6d0b0 Fix PEP257 issues 2016-03-08 13:35:39 +01:00
Paulus Schoutsen
e80309c03c Fix imports (using isort) 2016-02-18 21:27:50 -08:00
Fabian Affolter
8796187389 Equalize log messages 2015-12-22 22:02:55 +01:00
Fabian Affolter
97f9f8aa49 Update link to docs (Jekyll 3 update) 2015-11-09 13:12:18 +01:00
Fabian Affolter
fb8edca942 Add link to docs, fix typo, and update log output 2015-10-25 22:21:25 +01:00
Pascal Bach
67d5581a1b Add simple REST switch
The switch can get the state via GET and set the state via POST
on a given REST resource.
It is not able to control arbitrary urls but it allows controlling
switches exposed via "real" REST.
2015-10-23 23:40:14 +02:00