Compare commits

...

2399 Commits

Author SHA1 Message Date
Paulus Schoutsen e9fa1f1f83 Merge pull request #1182 from balloob/dev
0.13
2016-02-12 21:55:24 -08:00
Paulus Schoutsen 724d5bfe9d Version bump to 0.13 2016-02-12 21:51:34 -08:00
Paulus Schoutsen 938c9888a6 Merge pull request #918 from happyleavesaoc/snapcast
snapcast media player
2016-02-12 19:31:07 -08:00
Paulus Schoutsen b91e4cfb4a Merge pull request #1195 from persandstrom/kodi_thumbnails
kodi thumbnails
2016-02-12 19:03:22 -08:00
Paulus Schoutsen 7dd51034cd Merge pull request #1213 from MartinHjelmare/mysensors-light
Add mysensors light platform
2016-02-12 19:01:41 -08:00
Paulus Schoutsen 2f60ff224f Merge pull request #1223 from MartinHjelmare/update-mysensors-version
Update pymysensors version to 0.5
2016-02-12 18:55:06 -08:00
Paulus Schoutsen fc3a37cba2 Merge pull request #1224 from MartinHjelmare/fix-mysensors-version-error
Fix error in update method for V_STATUS
2016-02-12 18:54:12 -08:00
Paulus Schoutsen 223b7f85ee Merge pull request #1225 from nkgilley/ecobee-fix
fix ecobee sensor unique id.
2016-02-12 18:53:58 -08:00
happyleavesaoc 13b0beee31 snapcast 2016-02-12 18:35:32 -05:00
nkgilley@gmail.com ba530e5a16 fix ecobee sensor unique id. 2016-02-12 17:24:00 -05:00
Per SandstrÃom aafd36d2ce change url to host 2016-02-12 21:19:27 +00:00
MartinHjelmare 0492f0abd0 Fix error in update method for V_STATUS
* Remove check against V_STATUS to avoid error when using version 1.4
    of mysensors. V_LIGHT has the same integer value so V_STATUS is not
    needed.
2016-02-12 22:05:31 +01:00
MartinHjelmare 940799d0da Update pymysensors version to 0.5 2016-02-12 21:59:24 +01:00
Paulus Schoutsen 1ba60dc898 Update .coveragerc 2016-02-12 09:01:48 -08:00
Paulus Schoutsen 75d3d25969 Merge pull request #1129 from nkgilley/speedtest
Speedtest.net component
2016-02-12 08:59:19 -08:00
Paulus Schoutsen 06bd812b7b Make state unknown if None returned 2016-02-12 08:58:07 -08:00
nkgilley@gmail.com 7cb57583e2 fix line too long 2016-02-12 11:44:24 -05:00
nkgilley@gmail.com 3e3f5db2a5 use a windows & linux compatible regex 2016-02-12 11:30:55 -05:00
nkgilley@gmail.com 88fe28ea1b add update service 2016-02-12 09:55:28 -05:00
Paulus Schoutsen 8857c48c17 Merge pull request #1206 from turbokongen/rfxtrx-newprotocols
Supporting electricity sensors with ELEC2/3 protocol from latest pyRFXtrx (0.4)
2016-02-11 23:30:40 -08:00
Paulus Schoutsen 3c582d1e3c Merge pull request #1143 from balloob/rfxtrx
Rfxtrx
2016-02-11 23:30:34 -08:00
Fabian Affolter 19d12716ef Update docstrings 2016-02-12 08:21:39 +01:00
Fabian Affolter 57446cfb08 Add link to docs 2016-02-12 07:55:20 +01:00
Paulus Schoutsen ff6cb2b452 Update frontend icons + proximity icon 2016-02-11 22:21:06 -08:00
Paulus Schoutsen a3ec7998b1 Update frontend with garage door support 2016-02-11 21:55:50 -08:00
Paulus Schoutsen d892716bfa Merge pull request #1218 from kk7ds/influx-tests
Add tests for influxdb and fix a bug
2016-02-11 21:45:37 -08:00
Dan Smith 61e2da8827 Add tests for influxdb and fix a bug
This adds tests for the influxdb component. It also fixes a bug,
where username and password are required, but not gracefully
handled if they're missing from config.
2016-02-12 05:34:13 +00:00
Paulus Schoutsen abc039a3d0 Check coverage for statsd and splunk 2016-02-11 20:22:01 -08:00
Paulus Schoutsen 7ba7747ce8 Merge pull request #1217 from jaharkes/nest_heating
Nest binary sensor fixes
2016-02-11 20:15:02 -08:00
Jan Harkes b04ff7207c Make sure Nest is setup before the binary sensors. 2016-02-11 21:28:08 -05:00
Dan Smith 72235c48fb Merge pull request #1216 from kk7ds/fix-dan-broke-splunk
Re-allow splunk to report string states
2016-02-11 18:26:24 -08:00
Jan Harkes 3f7ff2b1d4 The Nest binary sensor can also track when heating system is running. 2016-02-11 21:24:51 -05:00
Dan Smith 484b7b64d7 Re-allow splunk to report string states
Splunk *can* take string states, so un-fix that wrong fix.
2016-02-12 02:20:15 +00:00
Paulus Schoutsen 7241762bcc Merge pull request #1209 from kk7ds/abstract-numeric-state
Abstract numeric state
2016-02-11 18:16:57 -08:00
Dan Smith 0a904acd4d Add some tests for splunk
This also fixes issue #1214, and I think another bug. The splunk
code will just take the value of state.state and try to serialize
it to json if it can't make it into a number. It did this before
I generalized that code. Since json.dumps() will fail on most anything
complicated, I think the right thing to do is *not* try to do that.
2016-02-12 01:45:30 +00:00
Dan Smith 76df759f4c Add simple statsd tests
These are not very amazing, but at least exercise the code a little
to make sure I didn't break anything. Hopefully they're useful in the
future too.
2016-02-12 01:45:30 +00:00
Dan Smith 4a2b956493 Convert statsd, influx, splunk, and graphite to use state_as_number()
Fixes #1205
2016-02-12 01:45:25 +00:00
Dan Smith 3aa34deaa2 Add state_as_number() helper
This adds state_as_number(), a helper method that tries to interpret
state as a number, for cases we can predict. It's a generalization of
what is copy-and-paste-ed into multiple other places.
2016-02-12 00:41:32 +00:00
nkgilley@gmail.com b00cad7095 fix travisci errors. 2016-02-11 19:27:05 -05:00
MartinHjelmare 2cf061c768 Add mysensors light platform
* Make light controllable independently with types V_LIGHT, V_DIMMER,
    V_RGB and V_RGBW. V_RGBW is not implemented in the frontend yet.
* Add discovery for light platform.
* Add optimistic mode config setting for switch and light
    to allow feedback state from actuator.
* Move S_LIGHT, V_LIGHT, V_STATUS types from switch to light platform.
* Change node update logging to debug from info level.
* Fix some inaccurate comments.
2016-02-12 01:22:35 +01:00
nkgilley@gmail.com e837e97c9d use track_time_change 2016-02-11 19:09:51 -05:00
Paulus Schoutsen df8afe51f4 Merge pull request #1212 from MartinHjelmare/fix-validate-config
Fix validate config in mysensors
2016-02-11 12:39:16 -08:00
Greg Dowling c8e6f89302 Merge pull request #1210 from balloob/fix_owntracks_passive_zone
Handle passive zones correctly.
2016-02-11 20:35:21 +00:00
pavoni 2e75a58372 Fix outtracks bug with passive zones. 2016-02-11 20:28:02 +00:00
MartinHjelmare ae2fd149a5 Fix validate config in mysensors
* Add check of port in config.
2016-02-11 21:03:13 +01:00
Greg Dowling ee62c2cc2b Merge pull request #1208 from kk7ds/static-wemos
Support manually-defined WeMo devices
2016-02-11 18:46:58 +00:00
Dan Smith 4cfa14c29d Support manually-defined WeMo devices
This is extremely useful if you want to support wemos that are on
another subnet or across a VPN. It also lets you sidestep the discovery
process, which is problematic for a lot of people and situations.

In order for this to work, we need to bump the pywemo requirement to
0.3.10, which includes my changes to make this possible.

WeMo devices can be manually configured by adding a static section to
the config, like this:

  switch:
    platform: wemo
    static:
       - 192.168.100.5
       - 192.168.100.6
2016-02-11 17:23:20 +00:00
Paulus Schoutsen 4ce1a67c13 Merge pull request #1077 from xrolfex/wink_garage_door_support
Wink Garage Door Support
2016-02-11 07:59:57 -08:00
Dan Smith 962463c1ab Merge pull request #1196 from kk7ds/honeywell-enumerate
Make Honeywell module enumerate all available thermostats
2016-02-11 07:53:05 -08:00
Paulus Schoutsen 74f06b6862 Merge pull request #1190 from flyte/apcupsd-component
Add APCUPSd component
2016-02-11 07:35:43 -08:00
Dan Smith d3d7d458e1 Make Honeywell module enumerate all available thermostats
This extends the HoneywellUSThermostat functionality to find and add
all thermostats in your account. So, we add a new config element called
'region' that is the primary trigger for this, and remove the 'id'
trigger since it was never in a released version.

This does a few extra things:
 - It names the thermostat what you have it named in your account,
   which is not something we get to know *unless* we emumerate.
 - It makes all thermostats on a given account use the same session,
   and thus we have to avoid doing an explicit login every time we
   refresh our data. That was causing some rate-limiting on their
   side when I was debugging, so this is probably good. Now, we use
   their existing keepalive pinger to determine if we're still logged
   in and only re-login if we need to.
2016-02-11 15:26:41 +00:00
Eric Rolf cca6b0c287 Test Fix. 2016-02-11 10:16:57 -05:00
Eric Rolf 23e3b8d2f2 Fixed Style Issue 2016-02-11 10:00:12 -05:00
Eric Rolf be9a2a043e Refactored Method Names. 2016-02-11 09:57:56 -05:00
Dan Smith cc4fa6cd38 Merge pull request #1194 from kk7ds/add-graphite-feeder
Add graphite feeder component
2016-02-11 06:36:19 -08:00
John Arild Berentsen 4d15367956 Supporting electricity sensors with ELEC2/3 protocol from latest pyRFXtrx (0.4) 2016-02-11 15:35:05 +01:00
Eric Rolf 175b49236c Fixed style attribute with redefined built in method names. 2016-02-11 09:20:47 -05:00
Eric Rolf fd0afaa204 Fixed Test Case Logic 2016-02-11 09:12:28 -05:00
Eric Rolf 034cec7152 Fixed Demo Test Cases 2016-02-11 09:06:35 -05:00
Eric Rolf f464d591c9 Update python wink requirement 2016-02-11 08:49:07 -05:00
Eric Rolf 06cb97adee Merge branch 'wink_garage_door_support' of https://github.com/xrolfex/home-assistant into wink_garage_door_support 2016-02-11 08:39:20 -05:00
Eric Rolf cab46b91e3 Updated Requirements All. 2016-02-11 08:38:05 -05:00
Eric Rolf 0da09b85de refactored test case 2016-02-11 08:37:17 -05:00
Eric Rolf 95d9bc48ea Updated Demo 2016-02-11 08:37:17 -05:00
Eric Rolf 6b962a2207 Updated coveragec, cleaned up constants, added test for demo. 2016-02-11 08:37:16 -05:00
Eric Rolf 18b3d3df57 Forgot to refactor demo. 2016-02-11 08:37:16 -05:00
Eric Rolf 5f6977acda Refactor Method Name For Open and Close. 2016-02-11 08:37:16 -05:00
Eric Rolf 89f6ef9f6c Updated requirements_all.txt 2016-02-11 08:37:16 -05:00
Eric Rolf d2ad0620ee Wink Garage Door Support 2016-02-11 08:37:16 -05:00
Eric Rolf aa13392983 refactored test case 2016-02-11 08:30:33 -05:00
Eric Rolf 6cbf19934f Updated Demo 2016-02-11 08:23:04 -05:00
Daniel f938134069 updated rfxtrx lib 2016-02-11 14:15:51 +01:00
Eric Rolf 7cdcb800a9 Updated coveragec, cleaned up constants, added test for demo. 2016-02-11 07:41:42 -05:00
Flyte 91fb2764cc Use a cache object to reduce the frequency of calls to APCUPSd 2016-02-11 07:33:53 +00:00
Paulus Schoutsen 82c5e2cf3c Merge pull request #1177 from Theb-1/dev-notify-rest
REST notify component
2016-02-10 23:05:34 -08:00
Flyte bb8981b611 Add apcupsd component. 2016-02-11 06:33:23 +00:00
Paulus Schoutsen b350f22a77 Update frontend to fix color picker 2016-02-10 22:18:08 -08:00
Paulus Schoutsen 40da28a0c7 Merge pull request #1192 from i-c/add-delay-to-launchtl-load
Add delay to launchtl load
2016-02-10 21:39:36 -08:00
Paulus Schoutsen 3bdb50510a Merge pull request #1202 from huanga/change_nest_battery-level_unit
Changing battery level unit to "V" instead of "%"
2016-02-10 21:33:10 -08:00
Dan Smith 7478c36b27 Add graphite feeder component
Like recorder, this component listens to all events and reports any
that it can to a graphite installation. This makes it easy to use
graphite for all your data collection and analysis. If you run
carbon-cache (the backend for graphite) on the local machine, no
configuration is required other than enabling the component.

For more info on graphite: http://graphite.wikidot.com/
2016-02-11 05:28:40 +00:00
Paulus Schoutsen b1f2c90bd0 Add MQTT service description 2016-02-10 21:23:27 -08:00
Ian Copp e53785f30c Fix __main__.py permissions change 2016-02-10 21:20:56 -08:00
Paulus Schoutsen 1a38354ed5 Merge pull request #1138 from flyte/mqtt-publish-template
Add template support to mqtt.publish service payload.
2016-02-10 21:13:02 -08:00
Andy Huang 02609d0ab5 Changing battery level unit to "V" instead of "%" as the API reports output voltage, not percentage.
This value matches with Settings > Technical Information's Battery information.
2016-02-10 21:12:43 -08:00
Paulus Schoutsen ce4f5ff29c Merge pull request #1197 from maxdrift/expose-baud-rate-mysensors-component
Expose baud rate config for MySensors component
2016-02-10 20:51:18 -08:00
Paulus Schoutsen 5190cc74c5 Merge pull request #1200 from MartinHjelmare/mysensors-unavailable
Use entity property available in mysensors
2016-02-10 20:45:48 -08:00
Paulus Schoutsen e83f8da342 Merge pull request #1185 from balloob/perf-states
Make State class more immutable
2016-02-10 18:53:02 -08:00
Paulus Schoutsen ddaeeba68b Merge pull request #1186 from balloob/remove-deprecated-methods
Remove deprecated methods from core
2016-02-10 18:52:57 -08:00
MartinHjelmare 75775a561b Use entity property available 2016-02-11 03:27:02 +01:00
Fabian Affolter 058315720f Fix typo 2016-02-10 23:59:34 +01:00
Flyte 4e0c7f8a3d Create additional mqtt helper function for using template payload. 2016-02-10 22:38:33 +00:00
Riccardo Massari c705ca4288 Expose baud rate config for mysensors component 2016-02-10 23:16:41 +01:00
Per SandstrÃom 15ad48a7a0 kodi thumbnails 2016-02-10 19:48:41 +00:00
Ian Copp c9c15c4cf7 Fix comment phrasing
Somehow I left out the "some". Whoops.
2016-02-10 11:32:56 -08:00
Ian Copp 3046bfce7b Add small time delay to restart-osx command 2016-02-10 11:29:25 -08:00
Flyte d52e2019c0 Update mqtt.publish() function to use template_payload. Reorganise publish service. Use mqtt.publish() in tests. 2016-02-10 11:11:02 +00:00
Paulus Schoutsen af8f6bcaba Remove deprecated methods from core 2016-02-09 23:59:31 -08:00
Daniel cdf0e80773 Improve the robustness of the rfxtrx module, and solve issue #1116 2016-02-10 08:44:34 +01:00
Paulus Schoutsen b0948bef5f Make State class immutable 2016-02-09 23:27:01 -08:00
Paulus Schoutsen 70a528c04b Merge pull request #1184 from balloob/group-of-groups
Support expanding nested groups
2016-02-09 22:56:30 -08:00
Theb-1 d796625098 flake8 fix 2016-02-09 22:51:44 -08:00
Paulus Schoutsen dc44ef7356 Support expanding nested groups 2016-02-09 22:43:07 -08:00
Theb-1 c5c4085ad4 upper/arg list/response improvements 2016-02-09 22:27:54 -08:00
Paulus Schoutsen 09b3aba51b Merge pull request #1136 from turbokongen/verisure-locks
Added support for lock connected to Verisure system.
2016-02-09 21:20:52 -08:00
Paulus Schoutsen 6f3aefde64 Merge pull request #1179 from roqeer/patch-1
Add name property to DHT sensor
2016-02-09 21:14:23 -08:00
Theb-1 b3a1491482 pylint: ignore 'too-many-arguments' 2016-02-09 21:12:33 -08:00
Theb-1 b7ff79da24 Fixes and updates
Remove setting defaults twice
Add timeout
Add optional title and target
2016-02-09 20:48:17 -08:00
roqeer 4bf4d94344 Changed to dict lookup with default value
Corrected on request
2016-02-09 22:09:44 +01:00
roqeer 3e26af5ff1 Correct bad-indentation 2016-02-09 19:09:48 +01:00
roqeer c1270cf0bb Add name property to DHT sensor
Add name to distinguish between multiple connected DHT sensors
2016-02-09 18:58:04 +01:00
Flyte 26fc637ab5 Add payload_template to mqtt 'publish' service call. 2016-02-09 15:41:31 +00:00
Fabian Affolter 66c5d96b43 Upgrade influxdb to 2.12.0 2016-02-09 16:32:05 +01:00
turbokongen@hotmail.com 41f908ed39 Added support for lock connected to Verisure system. 2016-02-09 13:17:05 +01:00
Theb-1 0f5487b95a Add REST notify component 2016-02-08 22:24:11 -08:00
Paulus Schoutsen 23c5159f6c Update frontend to fix map CSS 2016-02-08 21:58:41 -08:00
Paulus Schoutsen 4840dd297a Add unique ID to ecobee sensor 2016-02-08 20:39:09 -08:00
Dan Smith 4605742bb7 Merge pull request #1176 from kk7ds/mfi-tests
Add mFi tests
2016-02-08 19:07:48 -08:00
Paulus Schoutsen f222340c8e Merge pull request #1174 from balloob/wink-light
Wink light to inherit from light
2016-02-08 19:05:39 -08:00
Dan Smith b17df44402 Add tests for mFi switches 2016-02-09 03:03:26 +00:00
Dan Smith 895ddc8433 Add tests for mFi sensors
Note that some of the indirection here is so that I can reuse
a few things for mFi switch tests to follow.
2016-02-09 02:59:34 +00:00
Per Sandström d867d26612 Merge pull request #1168 from persandstrom/sigterm_handler
fix sigterm crash
2016-02-08 19:27:26 +01:00
Per SandstrÃom 564e328698 fix sigterm crash 2016-02-08 18:09:46 +00:00
Paulus Schoutsen 160b811ddf Wink light to inherit from light 2016-02-08 08:53:22 -08:00
Paulus Schoutsen 2e164e519a Merge pull request #1160 from stjohnjohnson/live-camera-stream
Fixes #1062 - If supported, directly stream the MJPEG from the remote camera
2016-02-07 14:43:00 -08:00
Paulus Schoutsen 779188ad27 Merge pull request #1167 from kk7ds/mfi-improvements
Mfi improvements
2016-02-07 14:40:47 -08:00
Paulus Schoutsen 3f6349d663 Merge pull request #1170 from balloob/fix_vera_dimmer_bug
Refactor VeraLight to inherit from Light, rather then VeraSwitch.
2016-02-07 14:39:16 -08:00
pavoni ac0dc10377 Refactor VeraLight to inherit from Light, rather then VeraSwitch. 2016-02-07 21:45:15 +00:00
Dan Smith 0a7db98b0e Round mFi sensor values to reasonable levels of precision
Most of the mFi sensors are able to reasonably provide accurate
readings to a tenth of a unit or so. This patch rounds them for
better display in the UI. Normally, I would expect this to be a view
action instead of altering the actual data emitted, but since these
values are reasonable for sensor precision, we're not really losing
anything. I followed the model from the openweathermap component, which
rounds for readability in the backend.
2016-02-07 20:51:00 +00:00
Dan Smith 8f690ff077 Add support for mPort input sensors
The mPort device has input pins that can be configured as digital or
analog inputs. We should support those as sensors.
2016-02-07 20:49:02 +00:00
Dan Smith 951fa603ff Support mPort voltage output switch types
An mPort device has a voltage output port that, if configured,
we should support like a switch.
2016-02-07 20:48:57 +00:00
Dan Smith c113997609 Tweak mFi switch behavior to avoid false states
When we update the mFi server for the state of a switch, the new
state is not always reported immediately if we update right after
the action (the server is not RESTful).

This patch adds some internal target-state handling to report the
desired state on the next poll, allowing any subsequent polls to
override that state.

Also, bump the version requirement for mficlient to 0.2.2 to absorb
a bug fix.
2016-02-07 20:48:51 +00:00
St. John Johnson f700635445 Add support for mjpeg component to proxy it's own stream 2016-02-07 12:02:52 -08:00
Paulus Schoutsen d49fae86e4 Update frontend with entity picture fix 2016-02-07 11:33:01 -08:00
Paulus Schoutsen 64611ab2be Merge pull request #1157 from balloob/device-state-attributes
Clean up state_attributes vs device_state_attributes
2016-02-07 10:16:34 -08:00
Paulus Schoutsen 27dc2f61fb Merge pull request #1163 from balloob/migration-5-fix
Fix recorder migration 5
2016-02-07 10:16:24 -08:00
Paulus Schoutsen cd25c8f72d Clean up some query stuff 2016-02-07 10:07:27 -08:00
Paulus Schoutsen 9ad1d290af Fix migration 5 2016-02-07 10:07:08 -08:00
Fabian Affolter 90ef81d8d5 Merge pull request #1161 from fabaff/bitcoin
Add icon
2016-02-07 15:37:40 +01:00
Fabian Affolter 02efe903ab Add icon 2016-02-07 12:43:02 +01:00
Fabian Affolter 0bb63bf3f0 Move configuration details to docs and add link 2016-02-07 12:36:29 +01:00
Fabian Affolter e23db5d972 Some small changes 2016-02-07 12:03:01 +01:00
Fabian Affolter e311f89056 Move details to docs and update docstrings/comments 2016-02-07 12:00:35 +01:00
Fabian Affolter 757946293e Move configuration details to docs 2016-02-07 11:52:17 +01:00
Paulus Schoutsen 98c6e56ea4 Merge pull request #1159 from nickwaring/proximity
Proximity component
2016-02-07 00:54:47 -08:00
Nick Waring cd0cef6403 Component to track the proximity of devices to a zone 2016-02-07 08:52:32 +00:00
Nick Waring 0d2891ebcc Test file for the proximity component 2016-02-07 08:51:21 +00:00
Paulus Schoutsen fb6aded2e1 Update frontend with new dependencies 2016-02-07 00:15:09 -08:00
Paulus Schoutsen 8b7cfc831d Merge pull request #1133 from balloob/cast-fix
Fix Chromecast discovery
2016-02-06 23:06:23 -08:00
Paulus Schoutsen 987be65d55 Update frontend to support default_view 2016-02-06 23:01:44 -08:00
Paulus Schoutsen f08b77dc4c Clean up state_attributes vs device_state_attributes 2016-02-06 22:34:24 -08:00
Paulus Schoutsen 681b84e1bd Update frontend with FF url-sync fix 2016-02-06 22:07:30 -08:00
Paulus Schoutsen 4103d7463b Merge pull request #1155 from balloob/fix-kb-interrupt
Fix Ctrl+C with Subprocesses
2016-02-06 20:12:27 -08:00
Paulus Schoutsen 428750eeda Merge pull request #1151 from kk7ds/add-mfi
Add support for Ubiquiti mFi sensors and switches
2016-02-06 20:11:53 -08:00
Paulus Schoutsen 0ae36e1d28 Merge pull request #1140 from kk7ds/add-nx584-alarm
Add Caddx/GE/Interlogix NetworX alarm panel support
2016-02-06 20:09:25 -08:00
Philip Lundrigan d2e8721918 Merge pull request #1124 from philipbl/fix_influx
Fix InfluxDB field type conflict
2016-02-06 20:49:20 -07:00
Philip Lundrigan bbdc196127 Use entity_id attribute 2016-02-06 20:33:43 -07:00
Paulus Schoutsen a417156d84 Merge pull request #1154 from balloob/fix-time-utils
Fixed time zone conversion with no TZ specified
2016-02-06 19:10:14 -08:00
Dan Smith 3575ddb6ef Add Caddx/GE/Interlogix NetworX alarm panel support
This adds support for NetworX-based alarm panels and should work for
any such panel equipped with a NX584 serial interface module. This
includes NX-4/6/8/8E, where the NX8E has this interface built-in.

It requires the pynx584 module, and requires running the server
component somewhere that has connectivity to the panel via serial,
which may include a serial-over-lan connection.
2016-02-07 03:06:58 +00:00
Dan Smith ffc4822f50 Add support for Ubiquiti mFi switchable devices
This adds support for mFi devices that are swichable,
such as the mFi Outlet device.
2016-02-07 03:02:49 +00:00
Dan Smith a147304be9 Add support for Ubiquiti mFi sensors
This adds support for sensors based on Ubiquiti's mFi platform.
All ports/sensors are detected from the mFi controller and exposed.
2016-02-07 02:58:04 +00:00
Ryan Kraus a001780afb Fix Ctrl+C with Subprocesses
Added KeyboardInterrupt handling back to block_till_stopped method.
This is because Keyboard Interrupts are sent to both the parent and
child process in no particular order so both need to handle the
interrupt.
2016-02-06 21:50:06 -05: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 7eef831ff3 Merge pull request #1141 from kk7ds/add-uvc-cameras
Add Ubiquiti Unifi Video Camera support
2016-02-06 18:21:44 -08:00
Paulus Schoutsen 9fde97efed Merge pull request #1152 from balloob/bump-pyvera-version
Bump pyvera, pywemo, add available for wemo
2016-02-06 16:43:42 -08:00
MartinHjelmare d773ad1ecb Fix mysensors version errors
* The application of the version check in unit_of_measurement was
	messed up after the last refactor. Fix that again.
* An error could occur in device_state_attributes if there was a
	mismatch between used value_type in the device and mysensors
	version in config. Add try... except to handle that.

Bump pyvera version.

Bump pywemo version.

Add unavailable status before properly initialised for maker and insight.
2016-02-07 00:28:12 +00:00
Dan Smith cab1100a51 Add Ubiquiti Unifi Video Camera support
This adds support for Ubiquiti's UniFi Video cameras via their
NVR device (or service). By configuring just the address of the
NVR and a valid API key, all cameras are discovered and enabled,
including direct-to-camera image snapshot-based video support.
2016-02-06 22:57:44 +00:00
Dan Smith 3616d7a7ea Fix alarm service handler state updates
This changes the service handler dispatch code to always
call update_ha_state(), and cleans up the alarm platforms that
were calling it themselves.
2016-02-06 21:11:28 +00:00
Paulus Schoutsen d38ad57b7d Merge pull request #1142 from kk7ds/add-honeywellus-thermostat
Add Honeywell US thermostat support
2016-02-06 13:05:53 -08:00
Paulus Schoutsen b3e966665a Merge pull request #1150 from bradsk88/master
Updating to python-wink 0.5.0
2016-02-06 13:04:42 -08:00
bradsk88 6e69737e88 Updating to python-wink 0.5.0
Major bugfix.  ``` get_bulbs ``` and similar methods were always returning empty lists.

Better unit tests have been added to https://github.com/bradsk88/python-wink to avoid this regression.
2016-02-06 14:22:46 -06:00
Dan Smith 062fe79b3f Add Honeywell US thermostat support
This adds support for the US variant of the Honeywell connected
thermostat. The interface is super simple, so this doesn't add
any external dependencies. It supports basic temperature, setpoint,
and control.

Issue #998 notes that the existing honeywell module doesn't work
for US models, which is because they are totally different. In order
to indicate to the honeywell platform module that the thermostat
is a US-type, we key off of whether or not the thermostat id is
provided. This is something that US people have (and require to
identify one of potentially multiple thermostats in their account)
and EU people will not.
2016-02-06 20:14:40 +00:00
Paulus Schoutsen af0a44d976 Merge pull request #1144 from MartinHjelmare/fix-mysensors-errors
Fix mysensors version errors
2016-02-06 11:35:49 -08:00
Paulus Schoutsen 43613f000d Merge pull request #1147 from balloob/debug-flag
Fix Interactive Debuggers
2016-02-06 09:56:12 -08:00
Paulus Schoutsen dde80850a6 Merge pull request #1112 from balloob/switch-template
First cut of switch.template
2016-02-06 09:12:13 -08:00
Ryan Kraus 11a2b8888b Fixes for issue #1114
1. Moved RESTART_EXIT_CODE to constants so it can safely be used by
__main__.py.
2. Allowed __main__/main to return the desired exit code.
3. Forwarded the child processes exit code to the parent process to be
duplicated.
4. Added —debug flag to pass command to force Home Assistant to run in
only one process. A warning is printed to STDERR to indicate HASS is in
debug mode. Another is printed if HASS requests a restart in debug
mode. A restart request in debug mode will quit.
5. Added an argument to __main__/main/setup_and_run_hass to indicate
that it is running in the top process. This tells it to return the exit
code rather than exiting.
2016-02-06 09:48:36 -05:00
MartinHjelmare b700ec4faa Fix mysensors version errors
* The application of the version check in unit_of_measurement was
	messed up after the last refactor. Fix that again.
* An error could occur in device_state_attributes if there was a
	mismatch between used value_type in the device and mysensors
	version in config. Add try... except to handle that.
2016-02-06 10:57:42 +01:00
Fabian Affolter 614034d196 Update docstrings 2016-02-06 08:23:30 +01:00
Paulus Schoutsen c9d145cb13 Merge pull request #1120 from haraldnagel/dev
Add BloomSky weather station support
2016-02-05 20:06:53 -08:00
Harald Nagel b6a32098d1 Add BloomSky weather station support 2016-02-06 01:37:32 +00:00
Flyte 4cf85294db Add template support to mqtt.publish service payload. 2016-02-05 21:47:27 +00:00
Eric Rolf 6fc68e9c8a Forgot to refactor demo. 2016-02-05 15:16:56 -05:00
Eric Rolf ec88733b57 Refactor Method Name For Open and Close. 2016-02-05 15:10:53 -05:00
Eric Rolf 7ef2075520 Updated requirements_all.txt 2016-02-05 14:20:06 -05:00
Eric Rolf fbd0dbf8ee Wink Garage Door Support 2016-02-05 12:53:57 -05:00
Paulus Schoutsen 2ba237eac8 Merge pull request #1134 from fabaff/icons
Add icon
2016-02-05 07:33:31 -08:00
Fabian Affolter 6bf4532608 Add icon 2016-02-05 13:08:17 +01:00
pavoni 2622cf2e53 Use available, remove state, improve true,false tests. 2016-02-05 11:18:50 +00:00
Paulus Schoutsen a5db23afa4 Mock util.location by default 2016-02-04 22:26:02 -08:00
Paulus Schoutsen 2c4166b5f2 Update splunk.py 2016-02-04 22:06:27 -08:00
Paulus Schoutsen 8be9aaba4f Fix Chromecast discovery 2016-02-04 21:36:37 -08:00
Paulus Schoutsen 1b16d76c40 Merge pull request #1128 from miniconfig/splunk
Added a new component to log state changes to a Splunk instance using…
2016-02-04 20:58:12 -08:00
Paulus Schoutsen 1a6539ad41 Merge pull request #1110 from lukas-hetzenecker/feature-zwave-poll-and-scene
Z-Wave: Scene activation & Polling
2016-02-04 20:51:52 -08:00
Paulus Schoutsen 96066e94ab Merge pull request #1122 from molobrakos/tellduslive
reworked telldus live support
2016-02-04 20:46:23 -08:00
nkgilley@gmail.com 78e758925b remove commented lines. 2016-02-04 18:42:38 -05:00
nkgilley@gmail.com 19fc48f4a0 use raw regex 2016-02-04 18:39:09 -05:00
nkgilley@gmail.com d469970e5a Speedtest.net component 2016-02-04 18:21:37 -05:00
Erik 50a9b3a7c0 reworked telldus live support 2016-02-05 00:07:12 +01:00
miniconfig ab837f9070 Added a new component to log state changes to a Splunk instance using the HTTP Event Collector 2016-02-04 16:13:55 -05:00
Paulus Schoutsen 6149e509c3 Merge pull request #1127 from molobrakos/timedate
provide default icon
2016-02-04 13:04:09 -08:00
Erik f3b74079e0 provide default icon 2016-02-04 21:55:22 +01:00
Philip Lundrigan c580953bd8 Fix MQTT sensor 2016-02-04 12:38:48 -07:00
Philip Lundrigan fc3741911c Fix problem with field type conflict in influxdb 2016-02-04 12:38:48 -07:00
Lukas Hetzenecker 2589e78e84 Z-Wave: This small refactor adds the following features:
* The poll interval got fixed and the poll intensity gets configurable in the settings
* Activated scenes now fire an event
2016-02-04 19:54:43 +01:00
pavoni ced380f0cd Remove unneeded entity_id check and blank lines. 2016-02-04 17:24:38 +00:00
Paulus Schoutsen a33f1c61e5 Merge pull request #1108 from lukas-hetzenecker/regression-zwave-light
Z-Wave Regression: Fix state attributes of lights and switches.
2016-02-03 21:25:13 -08:00
Lukas Hetzenecker 8cf5ca0ba8 Regression: The device specific attributes of ZWave devices got lost.
Light and ZWaveDeviceEntity both have overwritten the property state_attributes
This includes the device specific attributes in the state_attributes again
2016-02-04 02:12:33 +01:00
pavoni b20d3f8b3a Update docstrings. 2016-02-03 23:23:19 +00:00
Paulus Schoutsen 1f34b3586e Merge pull request #1117 from philipbl/influx_ssl
Add ability to specify SSL for InfluxDB connection
2016-02-03 13:33:08 -08:00
Paulus Schoutsen 37dadd1ae0 Merge pull request #974 from sdague/domains
Add recording of domain to state tables
2016-02-03 12:26:31 -08:00
Paulus Schoutsen fac8d4b969 Merge pull request #1115 from sdague/test
add pytest-timeout to test runs
2016-02-03 12:24:35 -08:00
Sean Dague efcba8f1ca add pytest-timeout to test runs
This adds a default 30 second timeout on every test method so that
deadlocks or broken threads are move obvious in travis. It also passes
-v by default to make things a little more verbose on where things
fail when they are failing.
2016-02-03 15:13:30 -05:00
Sean Dague abc253c4c5 implement get_significant_states
This adds a new function to history module which returns significant
states. For most domains this is the list of state changes. For the
thermostat domain this also includes attribute changes, so that
changes in the current_temperature are exposed to the graphing layer.

Closes #881
2016-02-03 15:05:43 -05:00
Sean Dague 3d00735341 Add recording of domain to state tables
Some domains, like thermostat, need all state records, not just state
change ones, to provide accurate graphs. This introduces a new db
migration which adds a 'domain' column to all states so that is a fast
query.

Indexes were added to help with query performance.

This includes a data migration which post-date populates domain. On
large HA dbs this might take real time, as it has to touch every state
row. 100 MB db (91k states) updated in a couple of seconds on my
reasonably fast server. Be forewarned.

This is part of bug #881
2016-02-03 15:05:43 -05:00
Paulus Schoutsen ce75c590b1 Merge pull request #1109 from lukas-hetzenecker/bugfix-zwave-fibaro-wall-plug
Z-Wave: Bugfix for Fibaro Wall Plug component
2016-02-03 08:34:06 -08:00
pavoni 6e6c3c5cd5 Tidy. 2016-02-03 14:30:58 +00:00
pavoni 5521096c02 Add actions. 2016-02-03 14:29:25 +00:00
Fabian Affolter 356013118d Update docstrings 2016-02-03 15:13:53 +01:00
pavoni 9a9dbcfaea Refactor, support template logic values, add tests. 2016-02-03 13:16:13 +00:00
Lukas Hetzenecker 1c33e01b99 styleguide fix 2016-02-03 13:03:01 +01:00
Lukas Hetzenecker d09837fef6 Zwave: This is a bugfix for the Fibaro Wall Plug component
As discussed here ( https://www.domoticz.com/forum/viewtopic.php?f=6&t=5661 ) this components reports two different power consumption values.
Unfortunately only one of them is correct. Both of them map to the exactly same object id.
This bugfix gets rid of the incorrect one.
2016-02-03 12:44:11 +01:00
Paulus Schoutsen f5e736d271 Merge pull request #1105 from balloob/disable-location-in-tests
Disable location queries
2016-02-02 21:38:20 -08:00
Paulus Schoutsen 61630783f1 Disable location queries 2016-02-02 21:33:59 -08:00
Paulus Schoutsen 077797ac4f Merge pull request #1086 from carlosmgr/dev
update SSH for aruba device tracker
2016-02-02 18:33:49 -08:00
Paulus Schoutsen b14f7f7ed0 Merge pull request #1099 from balloob/sensor_template_startup_error
Sensor template startup error
2016-02-02 18:32:09 -08:00
carlosmgr 3d695405b7 pep8 2 time 2016-02-03 00:03:50 +00:00
carlosmgr 55932b048e fix pep8 2016-02-02 23:54:32 +00:00
Fabian Affolter b19fbd8e72 Update docstrings 2016-02-03 00:35:53 +01:00
Fabian Affolter 635369ad65 Update docstrings 2016-02-03 00:23:59 +01:00
Fabian Affolter bd8881cbe1 Add icon 2016-02-03 00:12:01 +01:00
Fabian Affolter 847e92f57a Update docstrings 2016-02-03 00:01:26 +01:00
Fabian Affolter 5cea8fda9f Update link to docs and add docstrings 2016-02-02 23:55:44 +01:00
carlosmgr 7f87df20c2 ssh aruba 2016-02-02 22:40:04 +00:00
carlosmgr e91c8e4143 ssh aruba.py
req pexpect
2016-02-02 21:49:11 +00:00
carlosmgr cd00ff8b56 Merge remote-tracking branch 'upstream/dev' into dev 2016-02-02 20:07:31 +00:00
Philip Lundrigan 018329b12b Add ability to specify ssl 2016-02-02 12:58:38 -07:00
pavoni a955f3db08 WIP commit - template state working, on / off still to do. 2016-02-02 19:25:17 +00:00
pavoni d344defc7e Switch to warning. 2016-02-02 16:26:17 +00:00
Paulus Schoutsen 2da422fd77 Merge pull request #1098 from balloob/media-player-test
Clean up and test media player
2016-02-02 08:09:40 -08:00
pavoni 93a38d39ef Add test for missimng attributes. 2016-02-02 14:15:06 +00:00
pavoni 3aad223c95 Change to warning if attributes missing. 2016-02-02 14:14:29 +00:00
Ryan Kraus 1a5d18fd66 Merge pull request #1012 from balloob/restart-service
Restart service
2016-02-02 07:15:40 -05:00
Paulus Schoutsen e7e540d4bb Clean up and test media player 2016-02-02 00:31:36 -08:00
Paulus Schoutsen 35613d7fbf Merge pull request #1097 from molobrakos/add-test
add test for unsafe yaml
2016-02-02 00:22:19 -08:00
Erik 00d1cab091 add test for unsafe yaml 2016-02-02 08:41:18 +01:00
Paulus Schoutsen 26efaa91a3 Merge pull request #1090 from balloob/fix_sensor_template_entity_id
Fix bug in sensor.template entity_id
2016-02-01 21:21:57 -08:00
Paulus Schoutsen 3c37ecc477 Merge pull request #1091 from TangoAlpha/dev
Improvements to device detection
2016-02-01 21:21:15 -08:00
Paulus Schoutsen 274aaabd93 Merge pull request #1094 from balloob/cast-multi-room
No longer ignore ports for Chromecasts
2016-02-01 21:16:50 -08:00
Paulus Schoutsen c8bfd27182 No longer ignore ports for Chromecasts 2016-02-01 21:07:33 -08:00
Tim 08ab7dba2c Fix whitespace 2016-02-02 00:21:15 +00:00
Tim 54cc35d729 Merge branch 'dev' of https://github.com/TangoAlpha/home-assistant into dev 2016-02-02 00:17:03 +00:00
Tim 031e7a4013 New liffylights release improves device detection
Increase device polling to 30 seconds
2016-02-02 00:15:38 +00:00
Paulus Schoutsen 41165695f0 Merge pull request #1071 from deisi/onewireupdate
Little improvement for the onewire platform
2016-02-01 15:26:22 -08:00
pavoni 9c33af60f2 Fix unreachable code! 2016-02-01 18:38:11 +00:00
pavoni 7c1241c1f8 Add another test, revise another. Improve coverage. 2016-02-01 18:30:39 +00:00
Tim 9caa4752a4 New liffylights release improves device detection
Increase device polling to 30 seconds
2016-02-01 18:29:43 +00:00
Malte Deiseroth cb2e75befd removed trailing whitespace 2016-02-01 19:24:08 +01:00
pavoni d54e10e54a Improve test coverage of error conditions. 2016-02-01 18:18:51 +00:00
pavoni 95748a6880 Generate entity id correctly, was using friendly_name. 2016-02-01 17:45:18 +00:00
Paulus Schoutsen 10a41a22dc Merge pull request #1084 from molobrakos/tellduslive
handle situation where no name is set yet for the sensor
2016-02-01 08:55:39 -08:00
Erik ac0b6ca50c handle situation where no name is set yet for the sensor 2016-02-01 17:42:08 +01: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 d9aff0c76d Merge pull request #1089 from balloob/yr
Added and fixed yr tests
2016-02-01 08:11:18 -08:00
Daniel 5005b20122 Added and fixed yr tests 2016-02-01 15:50:17 +01:00
carlosmgr b3ef2bd2d9 Update aruba.py 2016-02-01 12:23:20 +00:00
Fabian Affolter e29a2fa45a Fix typo 2016-02-01 11:49:44 +01:00
Fabian Affolter 395743005a Add link to docs, new docstrings, and update docstrings 2016-02-01 11:47:09 +01:00
Fabian Affolter 8de56bc8e2 Fix docstrings 2016-02-01 11:31:27 +01:00
Paulus Schoutsen 79b6269aa2 Merge pull request #1083 from balloob/fix-requirements
Fix gen_requirements_all
2016-02-01 00:00:51 -08:00
Paulus Schoutsen 525b206e1b Fix gen_requirements_all 2016-01-31 23:55:02 -08:00
Paulus Schoutsen 2f4e40db27 Merge pull request #1076 from MartinHjelmare/add-entity-online-prop
Fix 'unavailable' entity
2016-01-31 17:26:12 -08:00
MartinHjelmare 38c9f7a37a Fix 'unavailable' entity
* Report friendly_name, icon and customized attributes for 'unavailable'
  entities.
2016-02-01 02:16:56 +01:00
Paulus Schoutsen c725f7883a Merge pull request #1063 from stefan-jonasson/samsungtv
Added a new media_player platform for controlling Samsung TVs
2016-01-31 16:57:11 -08:00
Paulus Schoutsen 10f79ab45d Merge pull request #1073 from MartinHjelmare/add-entity-online-prop
Add new 'available' property to entity.py
2016-01-31 15:59:28 -08:00
MartinHjelmare 455593017d Add new 'available' property to entity.py
* Add 'available' property. Return True by default.
* Use new property in update_ha_state(). If available is False, set
  state to 'unavailable', through constant.
* Add STATE_UNAVAILABLE constant 'unavailable' in const.py.
* Fix docstrings in entity.py and const.py, according to PEP257.
  Ignore D203 and D105.
2016-01-31 23:58:19 +01:00
Malte Deiseroth d6b19aae48 - check for reasonable temperature values
- round temperature to one digit
2016-01-31 22:56:48 +01:00
Paulus Schoutsen 6519333e1d Merge pull request #1070 from balloob/input-select
Add input_select component
2016-01-31 13:44:32 -08:00
Paulus Schoutsen 41919e7339 Update frontend for input_select 2016-01-31 13:39:50 -08:00
Stefan Jonasson 1c10f218de Fixed duplicate import statements and made use of the config_helper 2016-01-31 22:17:00 +01:00
Paulus Schoutsen 96710ad410 Add input_select component 2016-01-31 12:52:51 -08:00
Paulus Schoutsen c95c3d9198 Update frontend with weblink support 2016-01-31 12:00:45 -08:00
Stefan Jonasson 5719743ec7 Fixed .coveragerc and requirements_all.txt 2016-01-31 20:02:51 +01:00
Per Sandström e2e8d4276f Merge pull request #1069 from persandstrom/vsure0.5.0
vsure 0.5.0
2016-01-31 19:33:09 +01:00
Per Sandström 3f03fefd35 vsure 0.5.0 2016-01-31 19:23:53 +01:00
Stefan Jonasson 2dab815f90 Fixes imports, styles and other misstates 2016-01-31 19:12:00 +01:00
Paulus Schoutsen 6a4b63f807 Merge pull request #1056 from flavio/scsgate
Add support for the SCSGate device
2016-01-31 09:34:07 -08:00
Flavio Castelli 8eef978241 Add support for the SCSGate device
Support the SCSGate device. This will allow home-assistant to interact
with BTicino/Legrand MyHome system.

Signed-off-by: Flavio Castelli <flavio@castelli.me>
2016-01-31 18:30:43 +01:00
Paulus Schoutsen 1789a08d21 Merge pull request #1065 from kennedyshead/weblink
Weblink component
2016-01-31 09:20:17 -08:00
magnusknutas de4dab74b1 Adding weblink component
Adding weblink component tests
2016-01-31 18:13:04 +01:00
Paulus Schoutsen 16b1529d14 Merge pull request #1059 from balloob/entity-component-enhancements
Add tests and custom interval for entity component
2016-01-31 09:03:55 -08:00
Paulus Schoutsen 0b8e097705 Remove unused environment util 2016-01-31 08:58:30 -08:00
Paulus Schoutsen b21be63220 Merge pull request #1066 from TangoAlpha/dev
Update for new liffylights release
2016-01-31 08:32:51 -08:00
Tim e6a8746dba Update requirements_all 2016-01-31 15:07:06 +00:00
Tim 1974eda51d Update for new liffylights release
Fix incorrect packet timeout/ack code causing flooding when no bulbs were online, which consumed all WorkerPool threads
2016-01-31 13:31:12 +00:00
Stefan Jonasson bd475f5db1 Added a new media_player platform for controlling Samsung TVs with a lan interface.
Configured like this
 media_player:
  platform: samsungtv
  host: <IP OF TV>
  name: <Name of the tv>
2016-01-31 10:06:39 +01:00
Paulus Schoutsen fce8815ab4 Support custom interval for platforms 2016-01-31 01:01:23 -08:00
Paulus Schoutsen 90e17fc77f Add tests for entity component 2016-01-31 01:01:23 -08:00
Paulus Schoutsen 6418634f3a Merge pull request #1049 from balloob/new-tests
Adding more unit tests
2016-01-30 23:32:34 -08:00
Ryan Kraus a230d00ed0 Added test for Introduction component
This test may seem useless, but it is good to ensure that default
components don’t ever crash HASS.
2016-01-30 22:50:56 -05:00
Ryan Kraus 5fdbe5fd9a More tests for Binary Command Sensor
1. Added a test for detecting STATE_OFF
2. Fixed tests for detecting STATE_ON
2016-01-30 22:41:29 -05:00
Ryan Kraus 283d621e90 Added tests for Binary Command Sensor 2016-01-30 22:32:25 -05:00
Ryan Kraus 2d0004f46a Another test for for command sensor
Added a test for command sensors with bad configurations.
2016-01-30 22:16:22 -05:00
Ryan Kraus 6a08f14120 Additional tests for Command Sensor.
1. Moved template testing out of main test.
2. Added test for bad command.
2016-01-30 22:13:42 -05:00
Ryan Kraus 97e867052d Added tests for command sensor
Added tests to create and check basic functionality of command sensor.
2016-01-30 22:01:10 -05:00
Ryan Kraus 2651021461 Added test for entity customization
Added test for entity customization from configuration. Processes a
sample configuration to hide an entity, creates the entity, updates ha
state, and then verifies customization made it through.
2016-01-30 21:27:00 -05:00
Erik 4b253d17ba use yaml safe loader 2016-01-31 00:46:08 +01:00
Paulus Schoutsen b7722ec452 Allow usage of words domain, service, call_id in service data 2016-01-30 15:18:26 -08:00
magnusknutas fd6086a5d6 Testing logbook service 2016-01-30 15:18:26 -08:00
Paulus Schoutsen 3e35bc06fc Merge pull request #1055 from TangoAlpha/dev
Update to new release of liffylights
2016-01-30 12:56:22 -08:00
Tim f76dee8a05 Update to new release of liffylights 2016-01-30 20:48:57 +00:00
Ryan Kraus 56ac4281c7 Better tear down of util/package tests
Explicitly removed temp directory at the end of util/package unit tests.
2016-01-30 14:39:17 -05:00
Ryan Kraus b8e149fe7d Cleaned up universal MP tests
Changed all assertEquals in universal media player tests to have
assumed value first.
2016-01-30 14:38:27 -05:00
Ryan Kraus 4a8f55e630 Revised package util tests
The package util tests were revised to pull the external library
pyhelloworld3 from an internal source rather than external. This speeds
up tests, makes tests more reliable, and removes dependency on internet
connection.
2016-01-30 14:08:32 -05:00
Ryan Kraus de61bcb80e Additional testing for logger component
Added an additional test for the logger component the validates the
filtering logic of the filters that were created during setup.
2016-01-30 13:23:35 -05:00
Ryan Kraus 4cc9606bcc Added test for logger component. 2016-01-30 13:03:46 -05:00
Ryan Kraus 8ac763c6f6 Added test for universal mp service routing.
Added tests to ensure that the Universal Media Player is routing
service calls correctly.
2016-01-30 12:26:28 -05:00
Ryan Kraus 6a75b524cb Removed unused private method from universal media player
The universal media player contained a private method that was replaced
by the update method. It was meant to be removed and wasn’t. This
commit removed that method.
2016-01-30 11:57:46 -05:00
Ryan Kraus c1d057407b Fixed typo in universal media player test. 2016-01-30 11:53:15 -05:00
Ryan Kraus c396dbb570 Added tests to check setup and config of universal media player. 2016-01-30 07:18:37 -05:00
Ryan Kraus 0631f5c59d Added tests for package utilities 2016-01-30 06:44:22 -05:00
Paulus Schoutsen 10f9c049bb Version bump to 0.13.0.dev0 2016-01-29 22:38:01 -08:00
Paulus Schoutsen d0bcec12b9 Merge pull request #1001 from balloob/dev
0.12
2016-01-29 22:37:38 -08:00
Paulus Schoutsen 9fc62c1851 Version bump to 0.12 2016-01-29 22:33:46 -08:00
Paulus Schoutsen 23d88cd4ad Merge pull request #1047 from haraldnagel/dev
Fix #1046 by correcting platform name
2016-01-29 22:14:21 -08:00
Harald Nagel 86f433067c Fix #1046 by correcting platform name 2016-01-30 06:05:09 +00:00
Ryan Kraus 106c53abf1 Revised HASS Core test
Changed the HASS Core test that tested KeyboardInterrupt handling to
now test SIGTERM handling. KeyboardInterrupts are no longer handled in
the HASS application process as they are handled in the HASS parent
process. SIGTERM is the proper way to now stop HASS.
2016-01-29 22:42:39 -05:00
Paulus Schoutsen 75232c43ce Merge pull request #1044 from w1ll1am23/googlevoice
Google Voice SMS notification support
2016-01-29 19:32:23 -08:00
Ryan Kraus b56369855a Cleaned up restart handling in __main__.py
1. Fixed logged message about SIGTERM binding failure.
2. Set to only restart HASS with an exit code of 100.
3. Fixed typo in comment.
2016-01-29 22:11:11 -05:00
William Scanlon 01a743c7d4 Log if target == NULL 2016-01-29 22:09:59 -05:00
William Scanlon 28f4283b40 Validate target 2016-01-29 22:04:02 -05:00
Ryan Kraus a41b66bb94 Cleaned up block_till_stop in core.py
1. Removed handling of KeyboardInterrupt. This will no longer happen
now that HASS is run in a subprocess. The KeyboardInterrupt will not be
sent to the parent process which will send a SIGTERM to the HASS
process.
2. Fixed logger warning about not being able to bind to SIGTERM.
3. Removed check for Windows OSs when binding to SIGTERM. This check
was originally put in place when HASS was binding to SIGQUIT. SIGTERM
exists in NT OSs, so the check is no longer required.
3. Now returning exit code of 100 when requesting a restart. This will
allow the parent process to only restart HASS if it is specifically
requested and not just on any encountered crash.
2016-01-29 22:02:39 -05:00
William Scanlon 375faa9c91 Fixed style error 2016-01-29 21:53:06 -05:00
Paulus Schoutsen ef132e4583 Add tests for color util 2016-01-29 18:44:21 -08:00
Paulus Schoutsen 05cbe54db3 Remove owntracks from coverage 2016-01-29 18:02:42 -08:00
Paulus Schoutsen ae7697b900 Merge pull request #1037 from balloob/owntracks_mobile_beacons
Owntracks - mobile ibeacon tracking.
2016-01-29 18:01:31 -08:00
Martin Hjelmare a8f7bc2324 Merge pull request #1034 from MartinHjelmare/refactor-s_v_types
Mysensors: Refactor s_types and v_types mapping
2016-01-30 01:04:06 +01:00
MartinHjelmare 9db0987e53 Refactor s_types and v_types mapping
To be able to handle new platforms with multiple used v_types but
single states, a new more strict mapping was required. Each s_type is
now mapped to its corresponding v_type(s) in a dict of lists.
2016-01-30 00:55:13 +01:00
pavoni 515307b404 Remove dev/null from build script. 2016-01-29 22:11:01 +00:00
pavoni 03e7ac2a0e Fix typo. 2016-01-29 22:11:00 +00:00
pavoni c5cdf6d7cf Copy kwargs, remove traces. 2016-01-29 22:11:00 +00:00
pavoni a3abd8bb08 Revise tracked beacon name. 2016-01-29 22:11:00 +00:00
pavoni 5a7e380396 Revise beacon name. Add debug. 2016-01-29 22:11:00 +00:00
pavoni 09ef2e1b8c Add docstring, remove trace. 2016-01-29 22:11:00 +00:00
pavoni 80d2f35cc5 First cut mobile beacon tracking. 2016-01-29 22:11:00 +00:00
William Scanlon ad57f27989 Added test exclude in .coveragerc 2016-01-29 16:54:56 -05:00
William Scanlon a6720f54b3 Fixed style errors 2016-01-29 16:48:01 -05:00
William Scanlon aaf75c7e45 Added target support for googlevoice 2016-01-29 14:14:27 -05:00
Martin Hjelmare c5de42e7b5 Merge pull request #1033 from MartinHjelmare/refactor-unit-of-measurement
Mysensors: Refactor unit of measurement
2016-01-29 18:21:15 +01:00
Paulus Schoutsen d6bb6a0777 Merge pull request #1020 from kennedyshead/dev
Adding service for logbook
2016-01-29 09:19:34 -08:00
Paulus Schoutsen f87c7d6732 Merge pull request #1023 from flyte/zigbee-pr
Add ZigBee integration and components.
2016-01-29 09:18:10 -08:00
MartinHjelmare 575e97a051 Refactor unit of measurement
* Add dict with map of units to v_types.
* Avoid numerous if, elif branches and return statements.
* Add custom unit decoupled from other units.
2016-01-29 18:11:58 +01:00
Flyte 902077d78b Catch ZigBee exceptions when communicating with the devices and log appropriate messages. 2016-01-29 16:45:49 +00:00
Flyte c17a4fca80 ZigBee: Ensure correct entity types are used for each component. 2016-01-29 12:00:53 +00:00
Flyte 241a768983 ZigBee: Remove extraneous update_ha_state() usage and use it more appropriately for initial state update. 2016-01-29 11:33:15 +00:00
Flyte 72cca0a91a ZigBee: Handle case in which Serial port is unable to open 2016-01-29 10:48:15 +00:00
Greg Dowling dd7a7f4c75 Merge pull request #1036 from balloob/owntracks_beacon2
Improve owntracks events, add support for stationary ibeacons.
2016-01-29 09:47:20 +00:00
pavoni 468a8a1013 Improve owntracks events, add support for stationary ibeacons. 2016-01-29 09:39:00 +00:00
magnusknutas 24d84dbb42 Added entity_id and domain 2016-01-29 08:13:46 +01:00
Paulus Schoutsen 893a14e8db Merge pull request #1035 from balloob/fix-imports
Fix imports and rename insteon to insteon_hub
2016-01-28 21:53:21 -08:00
Paulus Schoutsen cbc6323438 Fix imports 2016-01-28 21:45:26 -08:00
Paulus Schoutsen d6db00b55a Merge pull request #1022 from haraldnagel/dev
Move Insteon API KEY into configuration.yaml
2016-01-28 21:36:35 -08:00
Harald Nagel eebb736bf8 Add ability to control dimmable sources 2016-01-29 04:36:40 +00:00
Harald Nagel f192a15a8f Remove unnecessary try around import 2016-01-29 02:35:04 +00:00
William Scanlon 9ec44fbe32 Updated googlevoicesms version 2016-01-28 21:19:15 -05:00
William Scanlon ffc06e8bcb pygooglevoice-sms support 2016-01-28 21:07:59 -05:00
William Scanlon 9c7b2ce9fd pygooglevoice-sms support 2016-01-28 21:07:16 -05:00
Paulus Schoutsen 1de7dcdb5f Merge pull request #1025 from molobrakos/yr-position
allow monitoring weather at other location than home
2016-01-28 08:49:48 -08:00
Erik 9e7886b909 allow monitoring weather at other location than home (such as summer house) 2016-01-28 17:16:02 +01:00
Flyte 4045fb6862 Fix import-before-install of xbee-helper dependency. 2016-01-28 13:44:37 +00:00
Flyte dda4f84150 Add zigbee components. 2016-01-28 13:18:29 +00:00
magnusknutas fda88f8fda logbook.log the name of the game 2016-01-28 09:51:05 +01:00
Harald Nagel 3c05c8d1db Use validate_config, watch for import exception 2016-01-28 05:55:36 +00:00
Harald Nagel 21ec435430 Move Insteon API KEY into configuration.yaml 2016-01-28 03:01:32 +00:00
magnusknutas 24893bc28d Less complex service setup 2016-01-27 18:03:37 +01:00
magnusknutas 403b9cbe3e And with template support 2016-01-27 17:37:15 +01:00
magnusknutas 8b0d19835c Cleanup 2016-01-27 17:32:57 +01:00
magnusknutas c31522eea9 Logbook service 2016-01-27 17:27:55 +01:00
Paulus Schoutsen ee33aa73e1 Merge pull request #1017 from fabaff/psutil-upgrade
Upgrade psutil to 3.4.2
2016-01-27 08:08:21 -08:00
Paulus Schoutsen 47498e4aa9 Merge pull request #1016 from fabaff/cpuinfo-upgrade
Upgrade py-cpuinfo to 0.1.8
2016-01-27 08:07:55 -08:00
Fabian Affolter ef4661f1e6 Upgrade psutil to 3.4.2 2016-01-27 12:26:38 +01:00
Fabian Affolter b4070cfb78 Upgrade py-cpuinfo to 0.1.8 2016-01-27 11:43:49 +01:00
Fabian Affolter c750f16275 Update docstings 2016-01-27 09:34:14 +01:00
Fabian Affolter 2248c271fa Add link to docs 2016-01-27 09:25:44 +01:00
Fabian Affolter 87b33d5098 Move configuration details to docs 2016-01-27 09:23:44 +01:00
Fabian Affolter cf7c06d307 Update docstring and fix typos 2016-01-27 09:21:21 +01:00
Fabian Affolter 70d95cb6aa Add link to docs 2016-01-27 09:08:04 +01:00
Fabian Affolter 2c151c6db9 Update docstring 2016-01-27 09:01:08 +01:00
Fabian Affolter 3fc5a60634 Add link to docs 2016-01-27 09:00:01 +01:00
Fabian Affolter 94d2f23cfc Add link to docs and remove configuration details 2016-01-27 08:08:04 +01:00
Fabian Affolter 4bd102ddf5 Add twitter docs 2016-01-27 08:08:04 +01:00
Fabian Affolter 232aa792f1 Add link to docs and update docstrings 2016-01-27 08:08:04 +01:00
Paulus Schoutsen ce9f76a0be Add onewire to coverage 2016-01-26 23:07:01 -08:00
Paulus Schoutsen f3f592cdec Merge pull request #982 from stefan-jonasson/dev
Updated the entity names for all z-wave devices.
2016-01-26 22:51:34 -08:00
Stefan Jonasson 1d2cd0811b Updated Imports.
ZWave modules now import the domain from the base domain.
2016-01-27 07:37:41 +01:00
Paulus Schoutsen 886b581d2a Merge pull request #1002 from kennedyshead/dev
Running periodic tasks
2016-01-26 21:42:06 -08:00
Paulus Schoutsen 88387d3123 Merge branch 'pr/78' into dev
Conflicts:
	homeassistant/const.py
2016-01-26 21:07:53 -08:00
Ryan Kraus 3534c975f3 Added missing CONF_ICON constant 2016-01-26 22:46:01 -05:00
Ryan Kraus 519abbbfa2 Better handling of second KeyboardInterrupt
Now the second KeyboardInterrupt will be cleanly handled by the parent
process.
2016-01-26 22:41:57 -05:00
Ryan Kraus b596fa33d6 Implemented restart service
Implemented an OS and environment safe restart service. This works by
running Home Assistant in a child process. If the child process
terminates with an exit code > 0, HASS is restarted. SIGTERM and
KeyboardInterrupts to the parent process are forwarded to the child
process. KeyboardInterrupts will only be forwarded once. The second
KeyboardInterrupt will be handled by the parent.
2016-01-26 22:39:59 -05:00
Martin Hjelmare 14cd27aaa7 Merge pull request #1011 from MartinHjelmare/fix-unit-of-measurement
Fix unit of measurement
2016-01-27 03:40:50 +01:00
MartinHjelmare 2e175b88bc Fix unit of measurement
* Add version check in unit_of_measurement, to avoid error.
* Remove not needed metric check in unit_of_measurement.
* Add more value types to unit_of_measurement.
* Fix unit prefix
* Remove unused SCAN_INTERVAL variable.
2016-01-27 03:18:59 +01:00
Paulus Schoutsen 537a7789fd Merge pull request #1005 from fabaff/astral-upgrade
Updgrade to astral 0.9
2016-01-26 17:48:14 -08:00
Paulus Schoutsen 80d1ab78dd Merge pull request #1006 from fabaff/influxdb-upgrade
Upgrade influxdb to 2.11.0
2016-01-26 17:47:59 -08:00
Paulus Schoutsen 821238f889 Merge pull request #1007 from fabaff/telegram-upgrade
Upgrade python-telegram-bot to 3.2.0
2016-01-26 17:47:42 -08:00
Paulus Schoutsen 33a9ec0106 Merge pull request #1008 from fabaff/blockchain-upgrade
Upgrade blockchain to 1.2.1
2016-01-26 17:47:14 -08:00
Paulus Schoutsen a8f0f313c8 Merge pull request #1009 from fabaff/docstrings
Update docstrings
2016-01-26 17:46:56 -08:00
Martin Hjelmare 6796219f37 Merge pull request #1010 from MartinHjelmare/fix-device-attr
Fix device_state_attributes
2016-01-27 02:43:34 +01:00
MartinHjelmare 1dae22a465 Fix device_state_attributes
* Return a dict with keys as the names of the enum members instead of
	the member values.
* This fixes a TypeError: unorderable types: int() < str()
2016-01-27 02:33:21 +01:00
Fabian Affolter 7aba78f96e Update docstrings 2016-01-27 00:08:06 +01:00
Fabian Affolter 06cf07b097 Upgrade blockchain to 1.2.1 2016-01-26 23:53:30 +01:00
Fabian Affolter 271af2c608 Upgrade python-telegram-bot to 3.2.0 2016-01-26 23:47:06 +01:00
Fabian Affolter 8c6ce217e6 Upgrade influxdb to 2.11.0 2016-01-26 23:45:39 +01:00
Fabian Affolter 5410a0c8f6 Updgrade to astral 0.9 2016-01-26 23:34:25 +01:00
Stefan Jonasson 1a422ecd5a Moved common z-wave node functionality to a common z-wave class 2016-01-26 22:11:27 +01:00
magnusknutas 6add5e387b Remove unused import 2016-01-26 21:41:12 +01:00
magnusknutas ca070a36e3 Dont wrap '/int' parameters with tuple 2016-01-26 21:38:07 +01:00
magnusknutas 2c3a6e7905 Remove not needed log warning 2016-01-26 21:30:00 +01:00
magnusknutas 0a4e857901 And a test just to see if nothing works if not providing any vars 2016-01-26 21:21:54 +01:00
magnusknutas d4b444823c Tests for time and a fix for wrong access of _LOGGER 2016-01-26 21:11:30 +01:00
magnusknutas 2382dffbf4 pushed test code :) fixed now 2016-01-26 20:49:51 +01:00
magnusknutas 33b0f4d05d Fixes bug in time trigger and adds test for ex. /two 2016-01-26 20:43:29 +01:00
Stefan Jonasson 5b6371ecda Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
#	homeassistant/components/light/zwave.py
#	homeassistant/components/switch/zwave.py
2016-01-26 20:31:42 +01:00
magnusknutas 6f1f8ffea0 Merge remote-tracking branch 'upstream/dev' into dev 2016-01-26 20:23:48 +01:00
magnusknutas 1f6f2de9c6 Sorry, I was wrong they are needed 2016-01-26 19:37:53 +01:00
Martin Hjelmare b13e48bd71 Merge pull request #999 from MartinHjelmare/fix-not-adding-devices
Fix adding devices on the fly
2016-01-26 19:30:31 +01:00
magnusknutas 9a79ecf2d3 Remove warnings no longer needed (I think :D) 2016-01-26 19:25:41 +01:00
magnusknutas ebd475b380 Unused import was the problem 2016-01-26 18:50:25 +01:00
magnusknutas cff77a175d Year periodic test (just to trigger travis but should maybe be here anyway) 2016-01-26 18:44:41 +01:00
magnusknutas 726637b867 New and improved handling of the matching! Kudos to @balloob 2016-01-26 18:37:19 +01:00
MartinHjelmare 9117fa6eb8 Fix adding devices on the fly
Devices were not added without persistence enabled and restart of HA.
Node id was added to defaultdict(list) by mistake when checking if list
of defaultdict was empty.

* Fix adding devices in mysensors_callback.
* Change devices to regular dict.
2016-01-26 18:12:13 +01:00
magnusknutas 6ae57b5aaf Some warnings if input is wrong for periodic tasks 2016-01-26 17:35:12 +01:00
magnusknutas e8e2814313 Warnings for not divisible settings 2016-01-26 17:30:55 +01:00
magnusknutas a918be517d test past midnight support for hours 2016-01-26 17:13:18 +01:00
magnusknutas ec5d88b98e hourly periodic task 2016-01-26 17:06:50 +01:00
magnusknutas 13fbefcdf8 Running periodic tasks 2016-01-26 10:28:31 +01:00
Stefan Jonasson f4c9540a1b Updated teh entity_id generation
Entity ids will now look like this:
sensor.philio_technology_corporation_psm021_slim_multisensor_doorwindow_sensor_7
sensor.philio_technology_corporation_psm021_slim_multisensor_luminance_7
sensor.philio_technology_corporation_psm021_slim_multisensor_motion_sensor_7
sensor.philio_technology_corporation_psm021_slim_multisensor_tamper_sensor_7
sensor.philio_technology_corporation_psm021_slim_multisensor_temperature_7

sensor.philio_technology_corporation_psm021_slim_multisensor_doorwindow_sensor_8
sensor.philio_technology_corporation_psm021_slim_multisensor_luminance_8
sensor.philio_technology_corporation_psm021_slim_multisensor_motion_sensor_8
sensor.philio_technology_corporation_psm021_slim_multisensor_tamper_sensor_8
sensor.philio_technology_corporation_psm021_slim_multisensor_temperature_8

And if there is several values of the same type in a node the instance id will be appended like this (three switches in the same device):
switch.fibaro_system_unknown_type0202_id1002_switch_9
switch.fibaro_system_unknown_type0202_id1002_switch_9_2
switch.fibaro_system_unknown_type0202_id1002_switch_9_3
2016-01-26 09:33:26 +01:00
Fabian Affolter e72f61ce73 Update docstring 2016-01-26 09:11:04 +01:00
Paulus Schoutsen 4c056db3bb Fix Chrome url sync 2016-01-25 23:56:43 -08:00
Paulus Schoutsen c10a86d1bf Merge branch 'master' into dev
Conflicts:
	homeassistant/const.py
2016-01-25 22:58:06 -08:00
Paulus Schoutsen b97de5cef6 Merge pull request #1000 from balloob/view-url-sync
Update frontend with view url sync
2016-01-25 22:54:00 -08:00
Paulus Schoutsen 4233c0bc66 Update frontend with view url sync 2016-01-25 22:47:13 -08:00
Paulus Schoutsen b13008201e Fix lint issue 2016-01-25 21:31:21 -08:00
Paulus Schoutsen 125ad8630d Add views to demo 2016-01-25 21:27:36 -08:00
Paulus Schoutsen 5c3ad5d4c0 Update frontend 2016-01-25 17:57:33 -08:00
Paulus Schoutsen 414aa8563d Merge pull request #930 from TangoAlpha/dev
Add LIFX bulb support
2016-01-25 17:51:47 -08:00
happyleavesaoc d08a181c72 Merge pull request #994 from happyleavesaoc/orvibo_bump
Orvibo version bump
2016-01-25 19:34:21 -05:00
happyleavesaoc 80c6bf6744 bump orvibo version 2016-01-25 16:40:27 -05:00
Tim b1ba792715 Brightness from HA overrides brightness from HSV conversion 2016-01-25 21:19:27 +00:00
Per Sandström b99f6c1a46 Merge pull request #995 from persandstrom/vsure0.4.8
update python-verisure to version 0.4.8
2016-01-25 22:04:02 +01:00
Tim 1397f9e588 Fix logging typo 2016-01-25 20:58:10 +00:00
Tim bb7f92330d Update liffylights version 2016-01-25 20:53:21 +00:00
Per Sandström 7cbd780748 update vsure version 2016-01-25 21:39:41 +01:00
Tim 784fea2d56 Update for new liffylights version 2016-01-25 19:08:48 +00:00
Tim 97f0425252 Update requirements_all 2016-01-25 15:20:23 +00:00
Tim 11120a8743 Fix liffylights import 2016-01-25 15:19:50 +00:00
Tim 8009542b3e Add extra debugging
Add duration to power on
2016-01-25 13:30:52 +00:00
Tim 32cfa6998c Update requirements_all 2016-01-25 12:13:24 +00:00
Tim d10a5cf5e9 Update to v0.8.3 of liffylights 2016-01-25 11:54:41 +00:00
Tim 4089a7a0d3 Update requirements_all 2016-01-25 10:02:03 +00:00
Tim 5a926913d3 Update to v0.6 of liffylights 2016-01-25 10:00:15 +00:00
Paulus Schoutsen 6c91831baa Hide groups when they are views or auto defined 2016-01-24 23:45:06 -08:00
Tim 069dafa3a5 Update requirements_all 2016-01-25 07:38:37 +00:00
Paulus Schoutsen 4abc5c97cd Merge pull request #988 from auchter/thermostat-fan
Add service to control a thermostat's fan
2016-01-24 23:24:32 -08:00
Paulus Schoutsen bb3dd47088 Merge pull request #992 from balloob/sections
Add support for sections in the frontend [Fixes #100705168]
2016-01-24 22:58:27 -08:00
Paulus Schoutsen f6c53896e3 Allow groups to be used as views 2016-01-24 22:54:45 -08:00
Paulus Schoutsen ad2e2d916b Merge pull request #979 from rmkraus/automation-decorator
Automation Decorator for custom components
2016-01-24 21:22:19 -08:00
Ryan Kraus 8406f81811 Removed decorator callback
The decorator callback was not actually necessary so it was removed and
replaced with a partial function instead.
2016-01-25 00:14:16 -05:00
Ryan Kraus bcdfc555e0 Removed service decorator from event decorators 2016-01-24 23:09:09 -05:00
Ryan Kraus 3b89102338 Fixed lint issue from merge
extract_entity_ids from the service helpers was overwriting the service
decorator with one of its attributes. This was fixed.
2016-01-24 23:00:43 -05:00
Ryan Kraus 60dd2d441d Merge remote-tracking branch 'balloob/dev' into automation-decorator
# Conflicts:
#	homeassistant/helpers/service.py
#	tests/helpers/test_service.py
2016-01-24 22:51:00 -05:00
Ryan Kraus 5830da63b1 Moved service decorator to service helpers
Moved the service decorator to the service helpers module and moved the
associated tests.
2016-01-24 22:46:30 -05:00
Tim 50561ffe97 Fix long line 2016-01-25 03:39:13 +00:00
Tim 74e8446556 Bump version of liffylights 2016-01-25 03:34:24 +00:00
Tim d94db5388c Add preliminary support for transition time 2016-01-25 03:32:55 +00:00
Ryan Kraus f66aeb2e73 Added event helper tests
1. Added tests for all event decorators
2. Added tests for sunrise and sunset event helpers
2016-01-24 22:23:56 -05:00
Ryan Kraus 54b82ecd91 Lint fixes and additions to event decorators
1. service decorator was overwriting the function name with one of its
arguments.
2. Accidentally left an extra argument in track_sunrise.
3. Added track_utc_time_change decorator.
2016-01-24 21:06:15 -05:00
Ryan Kraus 2fa98167c2 Updated example.py component
Cleaned up example.py to better handle failed loads.
2016-01-24 20:05:40 -05:00
Ryan Kraus 57725136c0 Many updates regarding event decorators
1. Added HASS to the arguments for callbacks that are created with
event decorators.
2. Added a service decorator.
3. Updated example.py in the example config to use the event decorators.
2016-01-24 19:52:22 -05:00
Ryan Kraus 40dbeb0b60 Another revision on event decorators
This revision of event decorators removes much of the complexity. The
decorated functions are no longer wrapped with a class that tracks
last_run, etc. Bootstrap now gives hass to the event_decorators module
before initializing components so the decorators no longer require
activation.
2016-01-24 17:46:05 -05:00
Ryan Kraus ef92940ffb A few lint fixes to event decorators. 2016-01-24 16:45:35 -05:00
Erik e7865c1d67 Merge pull request #990 from molobrakos/squeezebox-fix
bugfix for squeezebox cover art regression
2016-01-24 21:56:21 +01:00
Ryan Kraus 02e634c6a2 Fixed bugs to allow HA to boot again
1) helpers/event should not import the sun component unless it is
requested. This prevents circular import.
2) fixed import typo in bootstrap
2) bootstrap cannot import event_decorators until it is needed because
this leads to a circular import.
2016-01-24 15:55:47 -05:00
Ryan Kraus 0f937cad74 Initial pass at event decorators
Created event decorators for custom components. Decorators were created
for the events: track_state_change, track_sunrise, track_sunset, and
track_time_change.
2016-01-24 15:28:09 -05:00
Ryan Kraus 81dd1515ae Moved sunrise/sunset tracking to helpers
The automation component contained some very handy and generic
functions for tracking sunset and sunrise. This was moved to
helpers/event.py.
2016-01-24 15:07:09 -05:00
Ryan Kraus a65d0f0549 Reverting Automation decorator in favor of a new approach. 2016-01-24 14:44:48 -05:00
Michael Auchter 881c82c2df nest: implement fan control 2016-01-24 12:47:21 -06:00
Michael Auchter df94c909f7 thermostat: add service to control fan mode 2016-01-24 12:47:21 -06:00
Michael Auchter a0ed469aa2 thermostat: move fan attribute up to thermostat 2016-01-24 12:47:20 -06:00
Michael Auchter afa4fc4ef5 thermostat: split up services 2016-01-24 12:47:20 -06:00
Paulus Schoutsen df450c3d1f Merge pull request #987 from balloob/update-pynetgear
Update version pynetgear
2016-01-24 09:46:23 -08:00
Paulus Schoutsen dc5d652d31 Update version pynetgear 2016-01-24 09:43:06 -08:00
Paulus Schoutsen e4fe19fff0 Merge pull request #986 from turbokongen/dev
Small errorlog fix.
2016-01-24 08:54:54 -08:00
John Arild Berentsen f6f3f54228 flake8 complaint fix 2016-01-24 16:43:24 +01:00
John Arild Berentsen 6df67d2852 Send correct command to pyrfxtrx
Although it seems to work with send_on, it throws an logged error. Using correct command against pyrfxtrx removes this error.
2016-01-24 16:37:38 +01:00
Tim 2411d1f2c8 Fix wrongly generated requirements 2016-01-24 10:07:56 +00:00
Tim 9f6a1c75fa Fix wrongly generated requirements 2016-01-24 10:01:23 +00:00
Stefan Jonasson 1842e5909e Updated the entity names for all z-wave devices.
Z-Wave have a unique node id, this is now added to the entity name.

This is a change will break old configs.  The Z-Wave entity_id will have to be updated in configurations.

The reason for this change is that the old behavior created duplicate entity_ids if you have several similar devices. The order devices is included is not consistent so when the service was restarted the entity ids could change and the configuration for entities will be invalid.

There was also inconsistencies between the naming for sensors and switches.
(cherry picked from commit 33a78df)
2016-01-24 10:20:51 +01:00
John Arild Berentsen 6f31aacb90 Merge pull request #1 from balloob/dev
Updating base
2016-01-24 09:58:51 +01:00
Paulus Schoutsen e541b9ba77 Merge pull request #981 from balloob/ordered-yaml
Load YAML config into an ordered dict
2016-01-23 23:04:41 -08:00
Paulus Schoutsen 53484e46a3 Move generate_entity_id to entity helpers 2016-01-23 23:00:46 -08:00
Paulus Schoutsen de79a46d43 Move extract_entity_id to service helpers 2016-01-23 22:57:14 -08: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
Tim 706bbeae16 Add to .coveragerc 2016-01-24 02:17:52 +00:00
Paulus Schoutsen e5497d89f4 Merge pull request #980 from balloob/upgrade-cast
Upgrade PyChromecast version
2016-01-23 18:15:12 -08:00
Paulus Schoutsen 048ec0aa66 Merge pull request #964 from balloob/passive-zones
Allow passive zones
2016-01-23 18:15:06 -08:00
Paulus Schoutsen 03ed85b0a7 Merge pull request #971 from trollkarlen/smtp-fix
smtp: make smtp component thread safe
2016-01-23 18:08:03 -08:00
Paulus Schoutsen 9d92707fd7 Merge pull request #973 from turbokongen/dev
Added support for Dimming with lights in Rfxtrx module
2016-01-23 18:03:37 -08:00
Paulus Schoutsen 90c392e270 Upgrade PyChromecast version 2016-01-23 17:29:40 -08:00
Tim 6cb6cbfefd Update requirements 2016-01-24 01:18:18 +00:00
Tim 6d2bca0fd1 Import 3rd party library inside method 2016-01-24 01:13:51 +00:00
Tim 99286391e1 Fixes for lint 2016-01-24 01:00:02 +00:00
Tim 711f2da496 Update liffylights version 2016-01-24 00:43:50 +00:00
Ryan Kraus fbd68b6f89 Created automation decorator prototype
Created an initial iteration of an Automation decorator.
2016-01-23 19:39:59 -05:00
Paulus Schoutsen 85ebd0ab59 Merge pull request #977 from sdague/dev
fix typo in log message
2016-01-23 14:27:37 -08:00
Tim 58034219b6 Bump version liffylights 2016-01-23 22:23:46 +00:00
Tim 17f5a466d9 Separate LIFX code and HA component 2016-01-23 22:14:57 +00:00
Sean Dague 90ca6a0998 fix typo in log message
The plex component logs an htts url, which is confusing to people, as
they think something is broken, when it is not.

Closes #959
2016-01-23 16:06:50 -05:00
Erik ec2b433733 should be _id 2016-01-23 18:55:43 +01:00
Erik 492c4b7f00 style 2016-01-23 18:14:03 +01:00
Erik b3beb9f3c9 style 2016-01-23 18:08:54 +01:00
Erik 837e7affa7 only query artwork by track_id if id is available (7.7 vs 7.9 version issue?) 2016-01-23 17:48:14 +01:00
turbokongen 6d527842dd Another flake8 fix too long line 2016-01-23 12:14:00 +01:00
turbokongen e30915eb2c flake8 complaint fix 2016-01-23 12:08:21 +01:00
turbokongen 43e2b58f20 Fixing of various test errors 2016-01-23 12:00:03 +01:00
turbokongen d3c6c892a8 Small intendation fix 2016-01-23 11:50:09 +01:00
turbokongen a63edcf505 Added support for Dimming with lights in Rfxtrx module 2016-01-23 11:18:11 +01:00
Robert Marklund 0e7088ce3b smtp: make smtp component thread safe
Also fix so it does not require ip, port, username and password when using local smtp server.
Add debug config.

Signed-off-by: Robert Marklund <robbelibobban@gmail.com>
2016-01-23 10:43:10 +01:00
Paulus Schoutsen 0042e7725d Merge pull request #967 from HydrelioxGitHub/NetAtmo-icons
Add icons to NetAtmo sensors
2016-01-22 12:56:43 -08:00
hydreliox 613f8d0bd2 Add icons to NetAtmo sensors 2016-01-22 21:15:07 +01:00
Greg Dowling 61ca1ab2c1 Merge pull request #948 from balloob/sensor_template
First draft of sensor.template.
2016-01-22 16:49:49 +00:00
pavoni ad62591f43 Change error state to be 'error' rather than 'unknown', trace error. 2016-01-22 16:30:02 +00:00
Paulus Schoutsen 5ba33bc40e Merge pull request #950 from michaelkuty/dev
Add statsd component.
2016-01-22 07:41:04 -08:00
Michael Kutý 143b08d661 Add statsd component. 2016-01-22 16:18:15 +01:00
pavoni 87a9fd8252 Handle race condition on startup. 2016-01-22 11:30:04 +00:00
pavoni b1f7b5c6d7 Tidy, add test for ValueException logic. 2016-01-22 09:37:20 +00:00
Paulus Schoutsen bb97af1504 Allow passive zones 2016-01-22 00:00:36 -08:00
Paulus Schoutsen 9a092654e9 Merge pull request #962 from FreekingDean/dev
Adding Support for Insteon Hub
2016-01-21 23:31:16 -08:00
Dean d59b98ee2b Added Insteon Support 2016-01-22 02:28:36 -05:00
Paulus Schoutsen 6bbbbd9e17 Update mdi icons 2016-01-21 23:07:43 -08:00
Paulus Schoutsen 9fbedd8b5f Merge pull request #963 from balloob/scrip-service-helper
Script: use config service helper
2016-01-21 22:55:28 -08:00
Paulus Schoutsen a91163877f Script: use config service helper 2016-01-21 22:47:25 -08:00
Paulus Schoutsen 0acce86596 Merge pull request #958 from balloob/itunes-updates
iTunes Updates
2016-01-21 18:44:55 -08:00
William Scanlon c95b03f240 Fixed style 2016-01-21 18:32:10 -08:00
William Scanlon 56ce3e5f5a Wink siren support 2016-01-21 18:32:10 -08:00
pavoni 8b5751ad44 Merge branch 'dev' into sensor_template 2016-01-21 23:17:53 +00:00
pavoni c615272c06 Tidy. 2016-01-21 23:17:19 +00:00
Jon Maddox a3b8122707 not using these 2016-01-21 17:54:26 -05:00
Jon Maddox 682e3460e0 use custom material icons to represent speaker state 2016-01-21 17:45:30 -05:00
Jon Maddox 71dbd10b39 let port be optional 2016-01-21 17:18:52 -05:00
Paulus Schoutsen 7f143bcdf9 Merge pull request #957 from trollkarlen/yr.no-fix
yr.no: fix some bugs in the component
2016-01-21 13:33:36 -08:00
Robert Marklund f19a46dcfe yr.no: fix some bugs in the component
Someone forgot some in:s and ()
Also added windGust sensor.

Signed-off-by: Robert Marklund <robbelibobban@gmail.com>
2016-01-21 22:04:18 +01:00
Paulus Schoutsen 625f69443a Merge pull request #953 from trollkarlen/kodi-fix
kodi: remove traceback on state check
2016-01-21 12:18:28 -08:00
Robert Marklund 0bdd293572 kodi: remove traceback on state check
If the computer is sleeping that are running xbmc then
the traceback is printed in the log all the time.
Keep the traceback in debug mode of the module if needed.

Signed-off-by: Robert Marklund <robbelibobban@gmail.com>
2016-01-21 20:59:58 +01:00
pavoni f8072aae68 Merge branch 'dev' into sensor_template 2016-01-21 18:34:13 +00:00
pavoni 92afcae9be Add test. 2016-01-21 18:31:44 +00:00
pavoni a6f37c032b Revise to not need dependencies (or quoting)! 2016-01-21 17:35:33 +00:00
pavoni e66d15b71d First drafy of sensor.template. 2016-01-21 16:31:23 +00:00
Paulus Schoutsen 1098194a89 Merge pull request #937 from trollkarlen/sonos-multicast
sonos: add hosts and interface_addr to sonos config
2016-01-21 07:30:40 -08:00
Paulus Schoutsen 66d23cd15f Merge pull request #945 from zmrow/fix-exception-in-openweather
Fix #863 - Added a check for good pull from OWM and return if the object is None
2016-01-20 19:57:57 -08:00
zmrowicki@hotmail.com c3a1193ef9 Fix #863 - Added a check for good pull from OWM and return if the object is None 2016-01-20 19:36:33 -08:00
Paulus Schoutsen ec2d9af8dc Merge pull request #943 from trollkarlen/influxdb-fix
influxdb: fix the need of admin to run
2016-01-20 19:22:40 -08:00
Paulus Schoutsen f0e44728d7 Merge pull request #944 from HydrelioxGitHub/twitter_notify
Add Twitter as a notification platform
2016-01-20 19:21:38 -08:00
hydreliox f67747456f Clean some errors 2016-01-21 02:14:11 +01:00
hydreliox f6017a17b2 Add Twitter as a notification platform 2016-01-21 02:02:32 +01:00
Robert Marklund 89aa3cbc62 influxdb: fix the need of admin to run
Use select statment to show if db exits instead of
'SHOW DATABASES' which cant be run by a non admin user.
See https://github.com/influxdata/influxdb/issues/4785 for more info.

Also influxdb dont like empty writes('') so ignore state changes of that kind,
this happens on startup of home assistant.

Signed-off-by: Robert Marklund <robbelibobban@gmail.com>
2016-01-21 00:19:16 +01:00
Robert Marklund 543190dfb0 sonos: add hosts and interface_addr to sonos config
Config can now specify one or more hosts to connect and
also a interface_addr to multicast on if multiple interfaces exists.

Signed-off-by: Robert Marklund <robbelibobban@gmail.com>
2016-01-20 22:55:08 +01:00
Paulus Schoutsen fdc8c45a69 Merge pull request #940 from balloob/remove_sensor_state
Remove sensor state
2016-01-20 12:52:23 -08:00
pavoni d2d421ca8f Remove ghost debug code. 2016-01-20 20:02:03 +00:00
pavoni 7ad5b3a17b Fix bug related to maker_param types 2016-01-20 19:13:29 +00:00
Paulus Schoutsen c8dd9696b4 Merge pull request #939 from molobrakos/squeezebox-fix
artwork fixes
2016-01-20 09:16:32 -08:00
Erik 58ef69b95d less hacky way of getting unique cover art 2016-01-20 16:31:51 +01:00
pavoni 0de9229d75 More tidying. 2016-01-20 11:25:20 +00:00
pavoni f4c3ac2a62 Tidy 2016-01-20 11:19:00 +00:00
pavoni 6c5ceaf686 Remove sensor state from switch and wemo 2016-01-20 11:06:08 +00:00
Erik 54f65ae87d 1) artwork_url might be a relative url (such as /imageproxy). in that case, join it with the base url. note: urllib.parse.urljoin will handle case when the artwork url is absolute. 2) artwork would not be replaced in the user interface because the url did not change between tracks (http://.../cover.jpg). solved by appending internal hash of the media title to the url to force reload 2016-01-20 10:57:39 +01:00
Paulus Schoutsen 4f2dc3cc2a Merge pull request #934 from balloob/mqtt-protocol
Allow forcing MQTT protocol v3.1
2016-01-19 20:20:04 -08:00
Paulus Schoutsen a4ee2bd8ef Merge pull request #935 from balloob/0.11.1
0.11.1
2016-01-19 12:20:26 -08:00
MartinHjelmare d4629a7efe Fix missing binary sensor types
* Add missing binary sensor types to sensor/mysensors.
* Remove unneeded pylint disable.
2016-01-19 12:13:34 -08:00
Paulus Schoutsen 441ae73344 Merge pull request #936 from MartinHjelmare/fix-mysensors-sensors
Fix missing binary sensor types
2016-01-19 12:11:33 -08:00
MartinHjelmare 9249dc6dd3 Fix missing binary sensor types
* Add missing binary sensor types to sensor/mysensors.
* Remove unneeded pylint disable.
2016-01-19 19:26:40 +01:00
Paulus Schoutsen 4c4539caff Version bump to 0.11.1 2016-01-19 09:12:03 -08:00
Paulus Schoutsen 4c0ff0e0d0 Allow forcing MQTT protocol v3.1 2016-01-19 09:07:54 -08:00
Paulus Schoutsen 1ceee2d6c5 Fix MQTT reconnecting 2016-01-19 09:07:35 -08:00
Paulus Schoutsen cbb74d50ce Enforce entity attribute types 2016-01-19 09:07:27 -08:00
Erik c2d72bbf09 fix issue where sensors and switches were duplicated because of component getting initialized twice. closes #913 2016-01-19 09:06:57 -08:00
Paulus Schoutsen f97ba263c4 Allow forcing MQTT protocol v3.1 2016-01-19 09:00:40 -08:00
Paulus Schoutsen 85df9e98bd Merge pull request #922 from balloob/mqtt-fixes
Fix MQTT reconnecting
2016-01-19 08:45:49 -08:00
Paulus Schoutsen 2faafb9c0f Merge pull request #931 from molobrakos/fix-tellduslive-duplicates
proper initialization
2016-01-18 18:01:12 -08:00
Erik d43101f22a fix issue where sensors and switches were duplicated because of component getting initialized twice. closes #913 2016-01-18 19:41:41 +01:00
Tim 3d23cd10fc Attempt to fix ungrouped-imports pylint error 2016-01-18 18:30:09 +00:00
Tim 66cd8d264e Remove use of warn() 2016-01-18 18:27:46 +00:00
Tim 291910d74e Add LIFX bulb support 2016-01-18 18:10:32 +00:00
Paulus Schoutsen 7ac648d0ab Merge pull request #889 from Bart274/dev
Create command_sensor.py
2016-01-18 07:47:00 -08:00
Bart274 3b42390062 Update command_sensor.py 2016-01-18 13:48:09 +01:00
Bart274 a80917f530 Update command_sensor.py 2016-01-18 09:24:38 +01:00
Paulus Schoutsen 8fbb585874 Fix MQTT reconnecting 2016-01-17 21:39:25 -08:00
Ryan Kraus 027d97321f Merge pull request #911 from rmkraus/service-toggle
Added toggle service
2016-01-17 21:11:35 -05:00
Paulus Schoutsen 62a1c9687e Merge pull request #920 from balloob/enforce-entity-types
Enforce entity attribute types
2016-01-17 18:01:20 -08:00
Paulus Schoutsen a9c6f8c1d9 Enforce entity attribute types 2016-01-17 17:50:20 -08:00
Paulus Schoutsen 06b4fcc2cf Fix lint errors 2016-01-17 16:36:25 -08:00
Paulus Schoutsen 6dc2501116 ps - fix RPi GPIO imports 2016-01-17 16:29:41 -08:00
Paulus Schoutsen 54060f27ef Merge pull request #893 from joshughes/nest_sensor
Add the nest sensor for tracking data from nest
2016-01-17 15:16:25 -08:00
Ryan Kraus 85aa4fdd2e Revised entity toggle to use is_on
The toggle function in the Entity ABC was using state == STATE_ON to
determine whether the entity was on. This was revised to use the is_on
property instead.
2016-01-17 16:59:22 -05:00
Ryan Kraus 0624445627 Added tests for toggle service.
1) Added tests to toggle service.
2) Removed color_util import in light tests. It was not being used.
2016-01-17 16:42:18 -05:00
Joseph Hughes 4ca4941c82 fix pylint errors in sensor/nest 2016-01-16 12:56:38 -07:00
Joseph Hughes 4dbd84ead0 make sure everything inherits from NesSensor 2016-01-16 12:53:42 -07:00
Joseph Hughes 0495776a22 merge upstream dev 2016-01-16 12:52:22 -07:00
Joseph Hughes dd35551047 fix order of inhertiance 2016-01-16 12:47:08 -07:00
Paulus Schoutsen 9f61369156 Version bump to 0.12.0.dev0 2016-01-16 11:23:55 -08:00
Paulus Schoutsen bd536be66d Merge pull request #883 from balloob/dev
0.11.0
2016-01-16 11:23:40 -08:00
Paulus Schoutsen c5b69a0ee4 Update version to 0.11 2016-01-16 11:20:02 -08:00
Paulus Schoutsen 206b3a88a2 Merge pull request #910 from rmkraus/nginx-config
Added nginx sample configuration
2016-01-16 09:44:42 -08:00
Paulus Schoutsen 880bd011a9 Merge pull request #908 from persandstrom/verisure_code_digits
Verisure - code digits settings
2016-01-16 09:04:53 -08:00
Paulus Schoutsen 7de91a270a Merge pull request #905 from Xorso/alarmdotcom_bugfix
Alarmdotcom bugfix
2016-01-16 08:48:07 -08:00
Paulus Schoutsen 09973abe8a Merge pull request #897 from balloob/input-boolean
New component: input_boolean
2016-01-16 08:47:29 -08:00
Ryan Kraus 342a819fd4 Added toggle service
Added a toggle service to the homeassistant, light, switch, and
media_player domains.
2016-01-16 10:45:05 -05:00
Ryan Kraus 4bf185c868 Added nginx sample configuration
Added a sample nginx configuration with instructions detailing how to
setup a very secure HTTPS server for HA that servers over standard
ports without requiring HA to run as root.
2016-01-16 10:17:26 -05:00
Per Sandström 78742c016b code digits settings 2016-01-16 15:12:54 +01:00
Greg Dowling 1ed314f6f6 Merge pull request #906 from balloob/bump_vera_version
Bump pywemo version.
2016-01-16 11:40:10 +00:00
pavoni be23c6c86d Bump pywemo version. 2016-01-16 11:35:17 +00:00
Daren Lord a194c4f1bd Merge branch 'dev' of https://github.com/balloob/home-assistant into alarmdotcom_bugfix 2016-01-15 22:16:01 -07:00
Daren Lord edb24add6b Fixed but when alarm is trying to change state the state gets updated and changes the page. 2016-01-15 22:15:31 -07:00
Paulus Schoutsen bc88985889 Merge pull request #901 from philipbl/ssl
Increase security of using SSL
2016-01-15 17:32:51 -08:00
Greg Dowling 3d27dd3ec4 Merge pull request #902 from balloob/fix_vera_sensor_subscriptions
Another Vera fix
2016-01-15 21:46:27 +00:00
pavoni c2f5eb3073 Missed change. 2016-01-15 21:42:51 +00:00
pavoni 541b268721 Update to use refactored pyvera, fixes subscription issues - esp sensors. 2016-01-15 21:30:58 +00:00
Philip Lundrigan e77daed086 Merge pull request #900 from philipbl/fix_locative
Fix bug in Locative logic
2016-01-15 13:43:52 -07:00
Philip Lundrigan fdbb409331 Increase security of using SSL 2016-01-15 13:39:54 -07:00
Philip Lundrigan f96c5aa62f Fix bug in locative logic 2016-01-15 13:19:53 -07:00
Paulus Schoutsen c07a096e57 Merge pull request #899 from sfam/dev
Update RPi.GPIO version and code refactoring
2016-01-15 11:56:27 -08:00
sfam 48b6c5b5cb fix import BinarySensorDevice 2016-01-15 18:14:46 +00:00
sfam d8d59d9a66 remove rpi_gpio sensor 2016-01-15 18:05:48 +00:00
sfam 702dddbb2f update requirements_all 2016-01-15 17:28:32 +00:00
sfam 127488004c update coveragerc and requirements_all 2016-01-15 17:16:02 +00:00
sfam 7c925ac295 update comments 2016-01-15 16:53:46 +00:00
sfam 8617b92d1b Update RPi.GPIO version and code refactoring 2016-01-15 16:53:45 +00:00
Paulus Schoutsen bb80e3a9fc Merge pull request #898 from balloob/vera_fixes
Vera fixes
2016-01-15 07:43:03 -08:00
Joseph Hughes 80023f62d9 Merge remote-tracking branch 'upstream/dev' into nest_sensor
# Conflicts:
#	.coveragerc
#	requirements_all.txt
2016-01-15 08:18:16 -07:00
Joseph Hughes 9617288bd5 multiple inheritance for nest binary sensor 2016-01-15 08:16:33 -07:00
pavoni 4fd79afa42 Bump pyvera version. 2016-01-15 11:45:17 +00:00
pavoni 719f9a63d9 Fix style issue 2016-01-15 10:52:58 +00:00
pavoni 4bc33d0352 Bump pyvera version. 2016-01-15 10:34:14 +00:00
pavoni c4e1035638 Add humidity sensor, add units for humidity and light sensors. 2016-01-15 09:21:48 +00:00
Bart274 d40e889d3b Update command_sensor.py
Importing CommandSensorData from the command_sensor in sensors in order not to duplicate code
2016-01-15 09:01:58 +01:00
Bart274 41acc8fa43 Update .coveragerc
This shouldn't be excluded according to @balloob because it's a pure python component
2016-01-15 08:59:11 +01:00
Fabian Affolter 90c2aed7b4 Update docstrings 2016-01-15 08:55:59 +01:00
Fabian Affolter 5108602de3 Update link to docs and docstrings 2016-01-15 08:55:59 +01:00
Paulus Schoutsen 5ee17ffc58 Update frontend 2016-01-14 23:47:55 -08:00
Paulus Schoutsen 6b899ddc1d 100% test coverage for input_boolean 2016-01-14 23:25:25 -08:00
Paulus Schoutsen 0a711922ef Remove unnecessary instance variable 2016-01-14 23:19:08 -08:00
Paulus Schoutsen 475b631d9c Initial version input_boolean 2016-01-14 23:18:52 -08:00
Paulus Schoutsen 40c75f0a51 Merge pull request #887 from sdague/dev
Add support for Proliphix thermostat
2016-01-14 22:03:09 -08:00
Paulus Schoutsen 1dd99a6d5d Update frontend 2016-01-14 22:02:02 -08:00
Paulus Schoutsen bed9b038c8 Merge pull request #856 from w1ll1am23/Wink_power_strip_support
Wink power strip support
2016-01-14 19:23:41 -08:00
Joseph Hughes 9210c57c2d Fix lint errors and PR comments 2016-01-14 14:32:43 -07:00
Joseph Hughes 313cbda0aa fix multiple PR issues 2016-01-14 14:17:28 -07:00
Paulus Schoutsen 86b0e49995 Merge pull request #894 from Xorso/alarmdotcom
Adding in alarm control panel for Alarm.com accounts.
2016-01-14 13:01:58 -08:00
Joseph Hughes a39148dd38 fix pylint errors for Nest Sensor 2016-01-14 11:37:17 -07:00
Joseph Hughes b8c8c71b78 run requirements_all again for nest sensor 2016-01-14 11:28:28 -07:00
Joseph Hughes 65a3bf2325 fix merge error 2016-01-14 11:01:53 -07:00
Joseph Hughes ac34db3c8a Merge remote-tracking branch 'upstream/dev' into nest_sensor
# Conflicts:
#	.coveragerc
#	requirements_all.txt
2016-01-14 11:00:34 -07:00
Joseph Hughes f2e86ecd8e Merge remote-tracking branch 'upstream/master' into nest_sensor
# Conflicts:
#	homeassistant/const.py
2016-01-14 10:52:19 -07:00
Joseph Hughes 7b993da0de address PR comments for Nest Sensor 2016-01-14 10:48:24 -07:00
William Scanlon de5bee6359 Updated python-wink version 2016-01-14 08:56:59 -05:00
Daren Lord 34f124190c Fixing pylint errors 2016-01-14 06:29:12 -07:00
Sean Dague d867366be1 add proliphix thermostat support
The proliphix nt10e is an early network thermostat that supports an
HTTP interface. This adds basic support for it to home-assistant (get
/ set heating setback).
2016-01-14 06:32:08 -05:00
Bart274 d0d375d433 Update command_sensor.py 2016-01-14 10:27:11 +01:00
Bart274 d17aa103b4 Update command_sensor.py 2016-01-14 10:13:57 +01:00
Fabian Affolter f0af23a4f5 Add link to docs and update pressure unit 2016-01-14 09:16:20 +01:00
Paulus Schoutsen bdd6bb7918 Update frontend 2016-01-13 23:51:29 -08:00
Paulus Schoutsen 3ec49a0ef0 Merge pull request #892 from sdague/f_rounding
round min / max values for temperature
2016-01-13 22:50:15 -08:00
Daren Lord 7a2d049ce3 Removing LIFX from requirements_all.txt 2016-01-13 23:33:19 -07:00
Paulus Schoutsen 7fba4b354e Merge pull request #878 from HydrelioxGitHub/netatmo
Netatmo
2016-01-13 22:24:17 -08:00
Daren Lord 87cecd7e95 Adding to requirements_all 2016-01-13 23:22:42 -07:00
Daren Lord 303cb8e350 Adding alarmdotcom to coveragerc 2016-01-13 23:18:52 -07:00
Daren Lord 236ae94474 Merging dev branch 2016-01-13 23:14:58 -07:00
Daren Lord 308969e6dd Adding in alarm.com control panel. 2016-01-13 23:09:39 -07:00
hydreliox 4dd558a420 Update Requirements 2016-01-14 07:09:25 +01:00
Joseph Hughes 0e6a60b086 Add the nest sensor for tracking data from nest 2016-01-13 21:05:47 -07:00
Sean Dague 4fc0163139 round min / max values for temperature
In order for the polymer thermostat component to have sensible step
values the min / max values have to be round numbers. The current code
only does that for systems running in degrees C. For those of us in
silly land that still function in degrees F, this causes some
oddities in the UI.

Always round mix / max values to make it good no matter what
fundamental units we are in.
2016-01-13 21:22:56 -05:00
hydreliox 314d34a644 Update library lnetatmo requirements
Thanks to @rmkraus
2016-01-14 03:00:51 +01:00
Paulus Schoutsen 2745b0f99e Merge pull request #874 from xifle/zwave
Zwave inclusion / exclusion events
2016-01-13 12:47:39 -08:00
Bart274 c2e8646aed Update .coveragerc 2016-01-13 12:20:37 +01:00
Bart274 e5919c1bfe Update command_sensor.py 2016-01-13 12:19:20 +01:00
Bart274 c8961fcf99 Create command_sensor.py
This adds a binary command_sensor
2016-01-13 11:52:42 +01:00
hydreliox 58cee75c0e coverage and requirements updated 2016-01-13 09:06:16 +01:00
hydreliox 4f13236008 Merge remote-tracking branch 'refs/remotes/balloob/dev' into netatmo 2016-01-13 09:03:44 +01:00
Paulus Schoutsen 2a377a6125 Refactor syslog component for Windows users 2016-01-12 23:59:15 -08:00
hydreliox 058dba50cc Correct name using format instead of concatenation 2016-01-13 08:46:45 +01:00
Paulus Schoutsen e6846e7eb9 Convert asuswrt user/pass to strings 2016-01-12 22:28:53 -08:00
Ryan Kraus a0ddda4bc6 Updated frontend to newest commit 2016-01-12 22:15:23 -08:00
Ryan Kraus 57c0f96118 Renamed update_state to update in universal media player
Renamed update_state method in universal media player to update so that
it would be called by HA when the state was being published. Moved the
update_ha_state to a function inside of __init__. Updated the tests
accordingly.
2016-01-12 22:15:23 -08:00
Ryan Kraus a84429538b Fixed attribute configuration handling in universal media player
Forced all parsed attribute configurations to be of length 2. Removed
entity_id=None option from entity lookups. Explicitly passed entity
lookup information to _entity_lkp.
2016-01-12 22:15:23 -08:00
Ryan Kraus 07953fb7e3 Removed dependencies property from universal media player
The dependencies property was only being called once by the __init__
method so it was removed and the code was moved to the __init__ method.
The tests were updated to reflect this.
2016-01-12 22:15:23 -08:00
Ryan Kraus 12da6f531e Removed property from universal media player
The active_child_state property was unnecessary as it was not being
referenced outside the class. This commit removes it and updates the
tests accordingly.
2016-01-12 22:15:22 -08:00
Ryan Kraus 769f5aafb7 Added should_poll = False to universal media player 2016-01-12 22:15:22 -08:00
Ryan Kraus a1abab8ced Set universal media player to force refresh when updating HA 2016-01-12 22:15:22 -08:00
Ryan Kraus 270a998e3c Merged service calling method in universal media player 2016-01-12 22:15:22 -08:00
Ryan Kraus d829497c3d Changed universal media player to keep service attrs in dict
Revised universal media player to keep service data in a dictionary
rather than passing it around as magic parameters.
2016-01-12 22:15:22 -08:00
Ryan Kraus a8d5b0e5ec Made universal media player cache active player
Revised universal media player to cache the active player when updating
the state when any of the children change. Revised tests to accommodate
this change.
2016-01-12 22:15:22 -08:00
Ryan Kraus 85d732a45a Streamlined child state lookups in universal media player
1) Removed children property because it was only being used by one
method.
2) Removed option to return state as object from _entity_lkp as it was
no longer needed.
3) Used hass.states.get to get entity state objects.
4) Revised test to remove children property.
2016-01-12 22:15:22 -08:00
Ryan Kraus 8f3e8d29f0 Renamed SUPPORT_VOLUME_STEP flag in media_player
1) Renamed SUPPORT_VOLUME_BUTTONS to SUPPORT_VOLUME_STEP
2) Removed unused imports from tests.
2016-01-12 22:15:22 -08:00
Ryan Kraus ee4543d739 Using call_from_config in Universal Media Player
Changed universal media player to use the call_from_config helper to
call services specified in the configuration file. This was done to
copy what is done in the Alexa and Automation components.
2016-01-12 22:15:22 -08:00
Ryan Kraus 59456f20fb Added tests to universal media player and fixed bug
1) Fixed universal media player to maintain specified child order when
checking for active child.
2) Added many tests to universal media player.
2016-01-12 22:15:22 -08:00
Ryan Kraus 4a1f609893 Lint fixes and faster updating to universal media player.
1) Many lint fixes.
2) Bound the Universal Media Player to its dependencies so that its
state will be updated when one of its dependencies is changed.
2016-01-12 22:15:22 -08:00
Ryan Kraus 36214c73ee Better handling of entity lookups in Universal media player.
Allowed the lookup function in the Universal Media Player to return
either a state object or the actual state of an entity during lookup.
2016-01-12 22:15:21 -08:00
Ryan Kraus 20a1025a8c Added active_child attribute to universal media players.
The entity of the first active child is now reported in the attributes
for a universal media player.
2016-01-12 22:15:21 -08:00
Ryan Kraus ec85884d92 Added initial implementation of universal media player. 2016-01-12 22:15:21 -08:00
Paulus Schoutsen 22c01b956f Merge pull request #888 from balloob/lint-fixes
Lint fixes
2016-01-12 22:00:48 -08:00
Paulus Schoutsen 9cdf84dacf Update flake8 and pylint versions 2016-01-12 21:57:43 -08:00
Paulus Schoutsen 60f40800c4 Use mock HA for locative tests 2016-01-12 21:56:09 -08:00
Paulus Schoutsen 3b7b12bbd5 Make Flake8 happy 2016-01-12 21:53:27 -08:00
Paulus Schoutsen 9a1aad8e92 Merge pull request #882 from moonshot/mqtt-eventstream
Create mqtt eventstream component
2016-01-12 21:29:17 -08:00
Moonshot 6f398f59df Fix filtering of EVENT_CALL_SERVICE and EVENT_SERVICE_EXECUTED events 2016-01-12 22:57:03 -05:00
Moonshot 8ace656657 Create mqtt eventstream component 2016-01-12 22:56:26 -05:00
hydreliox a4481efe07 Code cleanup 2016-01-13 04:26:40 +01:00
hydreliox dc31ddbef2 Extract 'modules' as a constant 2016-01-13 04:19:27 +01:00
hydreliox 0c2fe4c5f3 Remove temp unit logic
HA should convert unit automatically
2016-01-13 04:16:25 +01:00
hydreliox 03febb81d3 Extract 'secret_key' as a constant 2016-01-13 03:45:43 +01:00
hydreliox 6f1a25d8d6 Add a configuration validation
All parameters are required
2016-01-13 03:43:10 +01:00
hydreliox f182f7dccd Remove uncessary requirement check
HA already check the requirement before setup the platform
2016-01-13 03:29:17 +01:00
Fabian Affolter 31fcd230b1 Update docstrings 2016-01-12 11:30:12 +01:00
Paulus Schoutsen 1ad5cae98e Merge pull request #884 from partofthething/zwave-alarm
Added z-wave alarm sensors to list of devices that can be auto-detected and used
2016-01-11 23:52:06 -08:00
ntouran 5af4864326 ZWave alarm sensor cleanup (pylint fixes) 2016-01-11 23:27:53 -08:00
Paulus Schoutsen ea8d278f8f Rename freesms to free_mobile 2016-01-11 21:05:32 -08:00
Paulus Schoutsen 88de9908ce Merge branch 'pr/879' into dev
Conflicts:
	requirements_all.txt
2016-01-11 21:03:52 -08:00
hydreliox 1bbecce5eb Add requirements and coverage exception 2016-01-11 21:03:22 -08:00
ntouran 2495226c87 Merge remote-tracking branch 'origin/dev' into zwave-alarm 2016-01-11 20:48:54 -08:00
ntouran c1aa1fb0e0 First attempt at adding Z-wave COMMAND_CLASS_ALARM 2016-01-11 20:46:45 -08:00
Paulus Schoutsen a5b198e2b8 Merge pull request #771 from MartinHjelmare/mysensors-component-switch
Mysensors component switch
2016-01-11 19:04:35 -08:00
xifle cd669239ae Changed zwave node add/remove events to services 2016-01-11 22:39:28 +01:00
hydreliox bc73a6829d Code formatting
Correct pylint errors
2016-01-11 09:30:32 +01:00
hydreliox 542b640ef0 FreeMobile Notify
First Commit for FreeSMS platform
2016-01-11 09:25:26 +01:00
hydreliox 7823fb9788 Merge remote-tracking branch 'refs/remotes/balloob/dev' into dev 2016-01-11 08:40:07 +01:00
hydreliox bcb42674fc Corrections due to pylint tests 2016-01-11 06:57:31 +01:00
hydreliox 1f1a46a8bd Remove unused library
Remove the library used for dev
2016-01-11 05:35:26 +01:00
hydreliox 7b999e6cd1 Convert Temperature output
Convert temperature from celcius to fahrenheit if the HA config need it
2016-01-11 05:29:32 +01:00
hydreliox c97a25cc86 Add configuration verification and sensors type
Generate an error in the configuration name of a module or a queried
sensor type is not correct.
Add support for co2 pressure and noise sensors
2016-01-11 05:21:38 +01:00
Greg Dowling cdf24ec205 Merge pull request #872 from balloob/vera-debugging
Vera updates
2016-01-10 17:34:49 +00:00
Paulus Schoutsen 579f4d4cca Merge pull request #875 from xifle/dev
Owntracks transition events minor improvement
2016-01-10 09:16:27 -08:00
xifle fce04e7ad0 Added inclusion / exclusion events
Events may be used to start inclusion / exclusion of zwave devices.
This is especially useful in the case of a Z-Wave stick without
"hardware" inclusion button.
2016-01-10 15:28:34 +01:00
xifle 6c94650603 Accept lower & upper case for owntracks 'home' region 2016-01-10 15:00:14 +01:00
pavoni fca8ad5b0b Tidy. 2016-01-10 12:48:36 +00:00
pavoni 4b4fb038e3 Update for new library, slightly revise switch logic. 2016-01-10 12:30:47 +00:00
MartinHjelmare 0b3a66dd1a Merge branch 'dev' into mysensors-component-switch 2016-01-10 04:27:39 +01:00
MartinHjelmare 2d8cf7de44 Fix wrapper and S_BINARY and bump req. version
* Wrap existing SerialGateway instance instead of subclassing
	SerialGatewat class.
* Add S_BINARY in switch platform only in version 1.5 of mysenors api.
* Use version 0.4 of pymysensors.
* Show gateway port as state attribute.
2016-01-10 04:10:38 +01:00
Paulus Schoutsen ad931eac60 Merge pull request #870 from balloob/update-pychromecast
Update PyChromecast dependency
2016-01-09 16:27:09 -08:00
Paulus Schoutsen 438e78610d Update PyChromecast dependency 2016-01-09 16:21:08 -08:00
Paulus Schoutsen 058f6f9303 Merge pull request #862 from balloob/alexa-service
Add calling service functionality to Alexa
2016-01-09 16:13:46 -08:00
Paulus Schoutsen 73cdf00512 More service helper tests 2016-01-09 16:01:27 -08:00
Paulus Schoutsen 12b5caed70 ps - strip entity IDs in service call 2016-01-09 15:51:51 -08:00
Paulus Schoutsen 18d2668e3b Merge pull request #869 from philipbl/mqtt-fix
Default to MQTT protocol v3.1.1
2016-01-09 15:27:33 -08:00
pavoni af21f72d17 Update pyvera version. 2016-01-09 22:58:28 +00:00
pavoni b64680e4a8 Revise to depend on vera subscription data updates, rather than talking to device. 2016-01-09 21:13:34 +00:00
Philip Lundrigan 9faedf0e67 Default to MQTT protocol v3.1.1 (fix #854) 2016-01-09 13:43:44 -07:00
Paulus Schoutsen 204c151113 Merge pull request #865 from fabaff/owm-update
Update pyowm to 2.3.0
2016-01-09 11:59:15 -08:00
Paulus Schoutsen 9b8256ec07 Merge pull request #867 from persandstrom/verisure_fix_lost_connection
Verisure fix lost connection
2016-01-09 11:47:39 -08:00
pavoni d61eb93c03 Remove throttle doesn't play well with subscriptions. 2016-01-09 16:16:41 +00:00
Fabian Affolter a2c6cde83d Update pyowm to 2.3.0 2016-01-09 13:20:51 +01:00
Paulus Schoutsen 825c91f0c3 Add calling service functionality to Alexa 2016-01-08 18:54:28 -08:00
Paulus Schoutsen d406d7fa94 Merge pull request #860 from philipbl/fix-test
Fix Yr test
2016-01-08 12:53:09 -08:00
Philip Lundrigan 3db6faab4d Fix yr test 2016-01-08 13:30:16 -07:00
Per Sandström 15a046f20c update module version 2016-01-08 19:52:03 +01:00
Per Sandström d3cd304f68 correced status text 2016-01-08 19:50:49 +01:00
Paulus Schoutsen 84fb96a42f Merge pull request #858 from balloob/remove-wemo-polling
Remove wemo polling
2016-01-08 08:19:33 -08:00
pavoni 5a1fed3980 Bump pywemo version. 2016-01-08 16:00:56 +00:00
pavoni bb8af3a2d5 Bump pywemo version, turn off polling, tidy trace. 2016-01-08 16:00:26 +00:00
William Scanlon 2803631906 Updated python-wink to 0.4.0 2016-01-08 08:25:26 -05:00
hydreliox 4c47ed31ff Correction to import lnetatmo right 2016-01-08 06:19:03 +01:00
hydreliox 1ed574b2a0 Point lnetatmo library directly from github 2016-01-08 05:34:51 +01:00
Fabian Affolter d69c1b848a Fix docstrings 2016-01-07 11:57:45 +01:00
Fabian Affolter 35c29dac3f Use mbar instead of hPa 2016-01-07 11:50:02 +01:00
Fabian Affolter aac44f3a2b Use the same unit for pressure as for the forecast sensor 2016-01-07 11:48:42 +01:00
William Scanlon 17dd8ddc9a Added wink power strip support 2016-01-06 12:22:50 -05:00
hydreliox a8b36d9baa Multiple Module Configuration
Handle multiple module (see configuration.yaml)
2016-01-06 04:36:04 +01:00
hydreliox 520a8d0d0d Add NetAtmo Platform
Alpha version of the platform.
API library is not yet on PyPI
2016-01-06 03:39:16 +01:00
Paulus Schoutsen 033bd30391 Merge pull request #844 from balloob/delay-group-switch-sensors
Fix calling turn_on for groups with mixed content
2016-01-05 08:55:58 -08:00
Paulus Schoutsen 99e14380fe Merge pull request #847 from molobrakos/patch-1
No need to call update() here
2016-01-05 08:55:48 -08:00
Erik 5576649d60 Update eliqonline.py 2016-01-04 21:36:39 +01:00
Erik 82cd2f4ed6 Update eliqonline.py 2016-01-04 21:31:42 +01:00
Erik 66f12afbb1 don't fail if error
don't fail if request for updated data raises exception in underlying library
2016-01-04 21:12:10 +01:00
Greg Dowling 431656bbcf Merge pull request #848 from balloob/fix-vera-bugs
Bump pyvera version to fix vera dimmer off bug, and avoid shutdown race condition
2016-01-04 19:34:17 +00:00
Erik a174a06e5c No need to call update() here
This also fixes a problem where the sensor is left uninitialized when the energy meter temporarily has lost connection with the hub. This caused the ELIQ Online server to return HTTP error 400: "user have no current power data", which in turn caused the used eliq library to fail during JSON parsing (issue reported).
2016-01-04 19:25:52 +01:00
Fabian Affolter 0d0fdb0adf Remove configuration details 2016-01-04 16:26:11 +01:00
pavoni 5f8dd65acf Bump pyvera version 2016-01-04 11:24:24 +00:00
Paulus Schoutsen 601211f1d9 Sun docs cleanup 2016-01-04 00:15:44 -08:00
Paulus Schoutsen 8983a97c70 Fix calling turn_on for groups with mixed content 2016-01-03 21:25:15 -08:00
Paulus Schoutsen 2e899bd61c Merge pull request #843 from rhooper/multiple-hues
Support multiple hue hubs using a filename parameter.
2016-01-03 18:39:21 -08:00
Roy Hooper d0a8a57ae4 Ensure filename arg is passed around everywhere it's needed. 2016-01-03 15:30:06 -05:00
Paulus Schoutsen 08aabd18ad New version frontend 2016-01-03 11:44:26 -08:00
Paulus Schoutsen 2478623ebc Merge pull request #840 from balloob/reproduce-group
Reproduce state upgrades
2016-01-03 11:36:45 -08:00
Paulus Schoutsen 736183e6f5 Fix bug in reproduce_state with complex state attributes 2016-01-03 11:27:30 -08:00
Paulus Schoutsen 31f2707b2f Merge pull request #841 from xifle/dev
Owntracks transition events
2016-01-03 11:19:02 -08:00
xifle d244d3b599 Fixed flake8 style errors 2016-01-03 17:42:49 +01:00
xifle 82904c59ce Fixed code style 2016-01-03 17:12:11 +01:00
Paulus Schoutsen f8b2570cb3 Group entities when reproducing a state 2016-01-03 02:32:09 -08:00
Paulus Schoutsen 6268840b55 Merge pull request #839 from philipbl/sun_fix
Fix for sun if condition
2016-01-03 00:27:33 -08:00
Philip Lundrigan c9ff0ab7eb Fix for sun if condition 2016-01-03 01:03:53 -07:00
Paulus Schoutsen cf1f9a29bf Merge pull request #833 from eiaro/dev
Added more sensors to Telldus Live
2016-01-02 17:05:54 -08:00
Paulus Schoutsen 48b1f8e137 Merge pull request #829 from joshughes/influx_hack
Interpolate what we are sending to influx so its not always a string
2016-01-02 16:59:31 -08:00
Ronny Eia 4b96a7c820 Untabified lines 2016-01-03 01:00:10 +01:00
Paulus Schoutsen 452ebdac8e Merge pull request #838 from balloob/travis-tweaks
Make CI erros more prominent
2016-01-02 15:46:03 -08:00
Paulus Schoutsen 7dc1499386 Make CI erros more prominent 2016-01-02 14:43:03 -08:00
Paulus Schoutsen 3ccc7787af Merge pull request #834 from R1chardTM/reference-fix
Fix reference known_devices.yaml in service description
2016-01-02 14:05:31 -08:00
Paulus Schoutsen 02879e79e6 Merge pull request #828 from sander76/honeywell_away_mode
Honeywell away mode
2016-01-02 14:05:20 -08:00
Richard 305c87a9c9 Fix reference known_devices.yaml 2016-01-02 16:01:58 -06:00
Ronny Eia 3abc78eef2 Added power sensor 2016-01-02 22:30:02 +01:00
Paulus Schoutsen 4a421e25b0 Simplify Rest sensors 2016-01-02 13:29:33 -08:00
Ronny Eia 86047eceb1 Added wind sensor 2016-01-02 22:28:15 +01:00
Ronny Eia 7edbb6aadc Added rain sensor 2016-01-02 22:21:04 +01:00
Roy Hooper 0361f37178 Support multiple hue hubs using a filename parameter. 2016-01-02 16:13:58 -05:00
sander 55c5d254d5 some more pylinting.. 2016-01-02 21:09:03 +01:00
sander 36f5caa214 more pylinting.. 2016-01-02 20:59:45 +01:00
sander 8c7898ed05 pylinting.. 2016-01-02 20:53:25 +01:00
sander 39de92960d line too long change 2016-01-02 20:27:40 +01:00
Paulus Schoutsen 6d35bdafee Merge pull request #832 from R1chardTM/device-tracker
Add service description device tracker
2016-01-02 10:34:05 -08:00
Paulus Schoutsen 217ffc215b Update PyNetgear version 2016-01-02 10:27:11 -08:00
xifle cbd3860585 Merge branch 'dev' of https://github.com/balloob/home-assistant into dev 2016-01-02 18:56:14 +01:00
xifle 5804dde0e9 Enables the use of owntracks transition events
By using the configuration option "use_events:yes" in the device_tracker section,
only 'enter'/'leave' events are considered to calculate the state of a tracker device.
The home zone is defined as the owntracks region 'home'. Other regions may also be defined, the name of
the region is then used as state for the device. All owntracks regions, the 'Share' setting must be enabled in the app.
2016-01-02 18:26:59 +01:00
Joseph Hughes e9b2cf1600 Ensure we send data to influx as float and not as a string value. 2016-01-02 10:24:23 -07:00
Richard cdf2179b3e Describe device tracker see service 2016-01-02 10:54:26 -06:00
sander 8f2ca856c7 added return False 2016-01-02 11:56:07 +01:00
Greg Dowling 622a6deb04 Merge pull request #820 from balloob/vera-subscriptons
Add ability to respond to events from Vera hub
2016-01-02 10:15:14 +00:00
Paulus Schoutsen a698bc477d Merge pull request #819 from rhooper/phue-deconz
Add support for deCONZ (Raspbee-GW hue-like API)
2016-01-01 22:21:48 -08:00
Roy Hooper a36ae4b24a Reduce chatiness 2016-01-02 01:01:11 -05:00
sander c703c89dbd implement away mode 2016-01-01 15:29:58 +01:00
sander b3227e491b Merge remote-tracking branch 'refs/remotes/balloob/dev' into dev 2016-01-01 14:44:25 +01:00
happyleavesaoc 9e83a80215 Merge pull request #788 from happyleavesaoc/command_switch_state
add statecmd to command_switch
2015-12-31 18:43:02 -05:00
happyleaves 9c85702c87 combine ifs 2015-12-31 18:39:40 -05:00
Paulus Schoutsen 9b7b39055d Merge pull request #826 from andythigpen/feature/is-state-attr
Add is_state_attr method.
2015-12-31 14:17:59 -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
Philip Lundrigan 326e26fbeb Merge pull request #825 from philipbl/locative
Update Locative component
2015-12-31 13:10:11 -07:00
Philip Lundrigan 394c87c40b Remove unnecessary condition in write_text 2015-12-31 13:05:24 -07:00
Philip Lundrigan ce152e9c94 Simplify logic 2015-12-31 12:39:36 -07:00
pavoni 9e0946b207 Turn off polling for sensor too! 2015-12-31 19:15:21 +00:00
Paulus Schoutsen da77edf8fc Merge pull request #818 from balloob/update-wemo-library
Improve wemo subscription error handling.
2015-12-31 11:06:43 -08:00
Paulus Schoutsen 6cb991d583 Merge pull request #814 from Mosibi/fix_mpd_title_keyerror
Fix KeyError on 'title' when title is empty
2015-12-31 11:04:30 -08:00
pavoni f8e5df237b Remove '#'' from requirements 2015-12-31 18:58:12 +00:00
Philip Lundrigan 5d953061e8 Remove unnecessary error checking 2015-12-31 11:56:27 -07:00
Philip Lundrigan 1bcca8cba1 Fix problem with test 2015-12-31 11:56:27 -07:00
Philip Lundrigan bdb6182921 Changes to locative based on tests 2015-12-31 11:56:27 -07:00
Philip Lundrigan 55d1ad94ef Add tests for Locative 2015-12-31 11:56:27 -07:00
pavoni 6773c35760 Bump pywemo version 2015-12-31 18:47:12 +00:00
pavoni 5f89b34831 Bump pyvera version 2015-12-31 16:09:05 +00:00
pavoni 90ae5c6646 Add missed import, fix style error. 2015-12-31 12:25:24 +00:00
pavoni a8bb75d070 Update sensor with subscription code, change to use pyvera library 2015-12-31 12:16:03 +00:00
pavoni d82859b6ea Turn off poll 2015-12-31 10:57:54 +00:00
Philip Lundrigan 7d41ce4e46 Switch from json messages to plain text messages 2015-12-30 22:43:32 -07:00
Philip Lundrigan c23375a18b Add case for test message 2015-12-30 22:42:11 -07:00
MartinHjelmare 4c4e5d5f47 Fix to remove old unused variables. 2015-12-31 06:19:47 +01:00
MartinHjelmare 6ff24ed047 Merge branch 'dev' into mysensors-component-switch
Conflicts:
	homeassistant/components/sensor/__init__.py
	homeassistant/components/switch/__init__.py
2015-12-31 06:05:06 +01:00
MartinHjelmare 69ed6fe6e7 Add gateway wrapper, fix discovery and callbacks
* Add gateway wrapper by subclassing serial gateway.
* Fix platform setup with discovery service.
* Fix platform callback functions with callback factory.
2015-12-31 05:48:23 +01:00
Roy Hooper 4e2d75a8f4 fix style 2015-12-30 16:59:22 -05:00
pavoni ae0dbbcfa5 Added support for event subscriptions 2015-12-30 19:44:02 +00:00
Philip Lundrigan 25e1432403 Fix style issues 2015-12-30 12:30:49 -07:00
Philip Lundrigan adfcfad488 Update locative functionality 2015-12-30 12:26:03 -07:00
Roy Hooper b0734e613f Add support for deCONZ (Raspbee-GW hue-like API) - Doesn't support the none transition type, so don't send it 2015-12-30 13:54:18 -05:00
Richard Arends 913c5ab47c identing error... sorry 2015-12-30 13:26:42 +01:00
Richard Arends 429904c437 Returning None when name and title are both not available
Removed trailing whitespaces
2015-12-30 13:00:34 +01:00
pavoni 41a36df801 Update pywemo version 2015-12-30 11:54:21 +00:00
Richard Arends 56a2ffca1d Changed if else statements. The following situations are handled now:
- name and title can be None
  - name can be None
  - title can be None
  - name and title can contain data
2015-12-29 22:10:09 +01:00
Richard Arends 6e2fb17f19 Fix KeyError on 'title' when title is empty 2015-12-29 17:52:05 +01:00
Paulus Schoutsen 586be7fad1 Prevent division by 0 xy->rgb color conversion 2015-12-29 00:09:38 -08:00
Paulus Schoutsen d9b30d1421 Pep257 fixes for core. 2015-12-27 21:14:35 -08:00
happyleaves e9059a3ed9 added test; addressed comments 2015-12-27 22:51:37 -05:00
Paulus Schoutsen 473d6b1d05 Fix console coloring for scripts 2015-12-27 19:19:29 -08:00
Paulus Schoutsen 7f17a50b4a Swap lint/requirements validation between Python versions 2015-12-27 18:04:38 -08:00
Paulus Schoutsen c7183a14a5 Tweak lint script colors for travis 2015-12-27 18:03:23 -08:00
Paulus Schoutsen c1eaf60461 VCR YR sensor test 2015-12-27 17:37:32 -08:00
Paulus Schoutsen ca6b957839 Make test deps explicit 2015-12-27 16:57:16 -08:00
Paulus Schoutsen 680385df93 Hide some build log spam 2015-12-27 16:35:14 -08:00
Paulus Schoutsen 62f21c3ac6 colorize lint errors 2015-12-27 16:31:53 -08:00
Paulus Schoutsen acfbbb3898 Update copyright 2015-12-27 16:31:52 -08:00
Paulus Schoutsen 4403fe941d Test config clean up 2015-12-27 16:31:52 -08:00
Paulus Schoutsen 244fde880e Convert MQTT event to lowercase 2015-12-27 16:31:52 -08:00
Greg Dowling df99e4ef22 Merge pull request #794 from pavoni/wemo-subscription
Adds Wemo event support - so wemo devices update HA more quickly
2015-12-28 00:11:34 +00:00
pavoni 976d9f2d08 Fix style issue 2015-12-28 00:04:30 +00:00
pavoni f5dd146676 Fix bug in shutdown 2015-12-27 23:56:18 +00:00
Paulus Schoutsen 7b00b19223 Merge pull request #807 from andythigpen/scene-fix
Fix issue with scene component when using YAML aliases.
2015-12-27 15:39:19 -08:00
pavoni b114ba56ea Fix style issue 2015-12-27 23:31:48 +00:00
pavoni 0d32bd7a19 Simplify callback logging, add stop log 2015-12-27 23:26:35 +00:00
pavoni 4feef3dd0d Simplify update state call, shutdown properly. 2015-12-27 23:09:39 +00:00
Paulus Schoutsen 9c3b1b7a96 Fix sun import issue 2015-12-27 15:00:49 -08:00
Paulus Schoutsen a09d731058 Merge pull request #803 from molobrakos/tellduslive2
added rudimentary support for telldus live
2015-12-27 15:00:01 -08:00
Erik 27e35d5f34 don't poll (turns out a request for state immediately a state turn on/off request will not return the newly updated state. import constants from tellive, not tellcore 2015-12-27 21:49:45 +01:00
Erik c8fa6cc127 bug fix 2015-12-27 21:47:49 +01:00
Per Sandström 468087e6bc Merge pull request #806 from persandstrom/verisure-pypi
verisure module from pypi
2015-12-27 21:10:18 +01:00
Andrew Thigpen d4b6a7343f Fix issue with scene component when using YAML aliases.
YAML aliases/anchors can make repetitive configuration sections easier
to deal with.  However when dealing with dictionaries, care needs to be
taken to not modify the original anchor since PyYAML utilizes a
reference when encountering an alias instead of a copy of the
dictionary.
2015-12-27 13:24:34 -06:00
Paulus Schoutsen 87c88078c8 Update sun to use elevation util 2015-12-27 11:22:10 -08:00
Paulus Schoutsen 8c1ebde1de Update requirements_all.txt 2015-12-27 11:10:14 -08:00
Paulus Schoutsen ab5a3f9de3 Clean up YR sensor 2015-12-27 11:07:25 -08:00
Per Sandström eb3da8cb03 verisure component from pypi 2015-12-27 20:07:09 +01:00
Paulus Schoutsen 9e1ecd7124 Fix flaky history test 2015-12-27 10:38:27 -08:00
Erik efbaf47dc7 reference constants from tellive package 2015-12-27 18:49:11 +01:00
Erik f10ecb2a8d remove obsolete comment 2015-12-27 18:42:10 +01:00
Erik 6e81391711 no percentage sign 2015-12-27 18:37:34 +01:00
Paulus Schoutsen 0d64f4a2d5 Merge pull request #804 from molobrakos/systemmon-icons
Systemmon icons
2015-12-27 08:54:14 -08:00
Erik d63e5a60ae added rudimentary support for telldus live 2015-12-27 12:32:08 +01:00
Paulus Schoutsen 384f1344fd Merge branch 'pr/792' into dev 2015-12-26 17:48:29 -08:00
Paulus Schoutsen add24915a3 ps - clean up sun automation tests 2015-12-26 17:48:20 -08:00
Paulus Schoutsen 089bbfc5cc Travis: Less verbose requirements_all.txt check 2015-12-26 17:19:53 -08:00
Paulus Schoutsen 1944b6a335 Merge pull request #796 from persandstrom/verisure-update
Verisure update
2015-12-26 08:17:08 -08:00
Paulus Schoutsen b8cfe63fc6 Merge pull request #797 from molobrakos/eliq-icon
replace default icon
2015-12-26 08:15:01 -08:00
Paulus Schoutsen 9e091a2c92 Merge pull request #798 from R1chardTM/hue-random
Add random color effect for Philips Hue
2015-12-26 08:10:09 -08:00
Paulus Schoutsen 41bcdc3356 Merge pull request #793 from philipbl/rest_bug_fix
Fix bug in rest sensor
2015-12-25 15:00:52 -08:00
Philip Lundrigan 40486676df Simplify error handling 2015-12-25 14:34:30 -07:00
Erik 6f2078cda3 bugfix 2015-12-25 22:02:10 +01:00
Erik b8d2f2ba37 moved into sensor types 2015-12-25 21:44:32 +01:00
Erik 03491fcc09 icons 2015-12-25 21:19:51 +01:00
Per Sandström 571073fe1f added docstring 2015-12-25 21:04:16 +01:00
Per Sandström a577d5c5fa revert accidental change 2015-12-25 20:57:30 +01:00
Per Sandström 160814f425 log texts 2015-12-25 20:42:03 +01:00
Per Sandström b83b36274a changed to python-verisure 0.4.1 2015-12-25 20:16:51 +01:00
Erik f3db4306c2 added icon 2015-12-25 18:50:35 +01:00
richard 5c7fb5d7ae Fix styling issues 2015-12-24 21:35:36 -06:00
richard 0dfc1c4e7a Add functionality set random color Philips Hue 2015-12-24 21:10:27 -06:00
pavoni 3f151428b7 Update pywemo version, use wildcard filter 2015-12-24 09:35:02 +00:00
Philip Lundrigan 2606e4d641 Simplify if statement 2015-12-24 00:38:49 -07:00
MartinHjelmare be25ea4f09 Fix avoid event bus for updates 2015-12-24 02:14:58 +01:00
MartinHjelmare 77959341a3 Merge branch 'dev' into mysensors-component-switch
Conflicts:
	homeassistant/components/sensor/mysensors.py
	requirements_all.txt
2015-12-23 23:45:32 +01:00
MartinHjelmare 9f54bcc21b Fix comments for pull request
* Fix cleaner user config.
* Remove bad disabling of linting.
* Extract default mysensors version into constant.
* Clean up selection of mysensors.CONST from version.
* Update mysensors update decorator to add devices and update values
	in one go.
* Fix persistence update.
* Clean up setup of ports.
* Setup of mysensors platforms from main mysensors component.
* Clean up v_types selection in mysensors sensor platform.
* Fix s_types and v_types selection version dependency in platforms.
2015-12-23 23:20:39 +01:00
pavoni 6d236b8169 Force state update 2015-12-23 18:03:40 +00:00
pavoni 09b894a4aa Fix style issues 2015-12-23 15:57:51 +00:00
pavoni 1e2b5e6991 Add support for subscriptions 2015-12-23 15:46:18 +00:00
Philip Lundrigan 496ec4bcca Fix bug in rest sensor 2015-12-23 03:37:03 -07:00
Paulus Schoutsen 3e51d0b539 Merge pull request #791 from andythigpen/logger-fix
Set the root logger to lowest level in logger component.
2015-12-22 23:13:45 -08:00
Andrew Thigpen c31a291a9c Set the root logger to lowest level in logger component.
In combination with resetting the log level on the handlers, this
allows messages lower than the default INFO to be logged when using
the logger component.
2015-12-23 00:57:41 -06:00
Paulus Schoutsen 96938bb33c Merge pull request #786 from philipbl/locative
Rename geofancy to locative (fix #761)
2015-12-22 19:02:08 -08:00
Paulus Schoutsen e7b1682a4e Merge branch 'pr/780' into dev 2015-12-22 18:57:42 -08:00
Paulus Schoutsen d191635fd8 Merge branch 'yr_no' into dev 2015-12-22 18:53:27 -08:00
Paulus Schoutsen bdd945c1c4 Set default log level to INFO 2015-12-22 18:39:46 -08:00
Paulus Schoutsen 6ccf63dae2 Merge pull request #790 from andythigpen/logger-fix
Reset log handlers to lowest level.
2015-12-22 18:38:58 -08:00
Paulus Schoutsen 987282da78 Logbook entry events are now lower case 2015-12-22 18:35:05 -08:00
Fabian Affolter 56186232f3 Enable logging-too-many-args 2015-12-22 22:33:20 +01:00
Fabian Affolter fb2da6be9a Remove space 2015-12-22 22:02:55 +01:00
Fabian Affolter 8796187389 Equalize log messages 2015-12-22 22:02:55 +01:00
Andrew Thigpen edff53609f Reset log handlers to lowest level.
This is necessary to enable logging lower than INFO for the error log file.
2015-12-22 13:50:59 -06:00
Paulus Schoutsen dbc91c1d48 Merge pull request #789 from balloob/release-101
Release 0.10.1
2015-12-22 09:05:55 -08:00
Paulus Schoutsen 0607c8f4b4 Version bump to 0.10.1 2015-12-22 08:59:32 -08:00
Paulus Schoutsen 7ccb6b960c Merge branch 'release-101' into dev 2015-12-22 02:20:25 -08:00
Paulus Schoutsen 561a78bef3 Fix EntityComponent deadlock 2015-12-22 02:19:55 -08:00
Paulus Schoutsen 9876a2a081 Fix Alexa bug if no value for slots 2015-12-22 02:08:46 -08:00
happyleaves fba5becd90 warn->warning 2015-12-21 20:18:00 -05:00
happyleaves d5179b4bdc add statecmd to command_switch 2015-12-21 19:49:39 -05:00
Philip Lundrigan ff8f22854c Add test 2015-12-21 16:28:26 -07:00
Philip Lundrigan 110d721c76 Add tests 2015-12-21 16:09:51 -07:00
Philip Lundrigan 8c010c8df4 Add ability to use sun as condition in automation 2015-12-21 16:09:27 -07:00
Philip Lundrigan 0ac1759395 Rename geofancy to locative (fix #761) 2015-12-21 11:05:20 -07:00
Paulus Schoutsen 07fb4ff243 Revert last fix. Will fix better. 2015-12-21 09:44:17 -08:00
Paulus Schoutsen 2650d235ea Fix: EntityComponent deadlock when adding new devices during update state 2015-12-21 08:56:27 -08:00
Daniel 9e89197284 small fix in yr sensor name 2015-12-21 10:42:42 +01:00
Daniel 8159d36114 small fix in yr sensor name 2015-12-21 10:36:25 +01:00
Daniel cf4f4ce8c7 changed to use requestes in stead of urllib for yr sensor 2015-12-21 10:33:19 +01:00
Daniel 9a1883bb49 changed to use requestes in stead of urllib for yr sensor 2015-12-21 10:29:12 +01:00
Daniel 8e16a443e5 Added yr sensor to requirements_all 2015-12-21 10:24:22 +01:00
Paulus Schoutsen 35411cd57e Version bump to 0.11.dev0 2015-12-20 15:32:51 -08:00
Paulus Schoutsen bc4ab4d70a Merge branch 'dev' 2015-12-20 15:31:22 -08:00
Paulus Schoutsen 901f63be0c Version bump to 0.10 2015-12-20 15:30:51 -08:00
Paulus Schoutsen 7ee71b1831 Merge pull request #778 from balloob/dev
0.10.0.rc1
2015-12-20 15:10:28 -08:00
Paulus Schoutsen 70a5704887 Merge pull request #779 from happyleavesaoc/torque
torque support
2015-12-20 15:04:46 -08:00
happyleaves 04316d9723 http fixes 2015-12-20 11:20:40 -05:00
Paulus Schoutsen 14246fe467 Merge pull request #781 from balloob/mqtt-light-template
Add template support to MQTT lights
2015-12-19 19:51:43 -08:00
Paulus Schoutsen 177590fd65 Simplify MQTT light code 2015-12-19 19:45:28 -08:00
Paulus Schoutsen 1c08923ffc Last test for 100% coverage of mqtt light 2015-12-19 19:36:38 -08:00
Paulus Schoutsen 7bb07cdc03 Remove MQTT light from coveragerc 2015-12-19 19:29:31 -08:00
Paulus Schoutsen 90c705354a Add template support to MQTT lights 2015-12-19 19:15:05 -08:00
Fabian Affolter 55a236f912 Update docstrings 2015-12-19 09:38:23 +01:00
happyleaves f071e3b4ac torque support 2015-12-19 00:19:41 -05:00
Paulus Schoutsen a6a30c5f22 Merge pull request #776 from balloob/travis-caching
Fix travis caching
2015-12-18 09:17:27 -08:00
Paulus Schoutsen dc8ac7386e Merge pull request #775 from balloob/chromecast-dependency-fix
Upgrade PyChromecast version
2015-12-18 09:08:29 -08:00
Paulus Schoutsen cc80ad00ff Fix travis caching 2015-12-18 09:07:34 -08:00
Paulus Schoutsen 824dd60aef Upgrade PyChromecast version 2015-12-18 08:58:13 -08:00
Fabian Affolter 2efca59352 Remove print 2015-12-18 17:34:23 +01:00
Fabian Affolter 4a0ec36fea Update error message 2015-12-18 13:47:13 +01:00
Paulus Schoutsen 9bf8835190 Merge pull request #772 from balloob/template-editor
Add template editor
2015-12-18 00:46:50 -08:00
Paulus Schoutsen 411ce04d75 Merge pull request #773 from balloob/travis-tweaks
Travis tweaks
2015-12-18 00:46:32 -08:00
Paulus Schoutsen 2e75f0b314 Remove quiet pip installs on travis 2015-12-18 00:35:53 -08:00
Paulus Schoutsen dd60cc020e Only validate requirements_all.txt on Python 3.5 2015-12-18 00:19:14 -08:00
Paulus Schoutsen 9dca22aa27 Only lint on Python 3.4 2015-12-18 00:14:31 -08:00
Paulus Schoutsen b5fc7f5e71 Verify requirements_all in Travis 2015-12-18 00:01:52 -08:00
Paulus Schoutsen 80d3552960 Add template editor 2015-12-17 23:33:09 -08:00
MartinHjelmare 845926236e Add config sample and fix requirements_all 2015-12-18 03:58:21 +01:00
MartinHjelmare eae07c070a Merge branch 'dev' into mysensors-component-switch 2015-12-18 03:39:41 +01:00
MartinHjelmare 659226886f Update .coveragerc and requirements 2015-12-18 03:37:49 +01:00
Philip Lundrigan a0ff8819a9 Make numeric_state error message more descriptive 2015-12-17 17:37:39 -07:00
Philip Lundrigan 4196d6a21c Merge pull request #770 from philipbl/fix_icloud
Small iCloud device tracker fix
2015-12-17 14:06:45 -07:00
Philip Lundrigan c564c73617 Return true when iCloud finishes setting up
Otherwise an error will be reported even though it set up correctly.
2015-12-17 13:31:33 -07:00
Fabian Affolter 5dabba3941 Move config to docs 2015-12-17 19:44:18 +01:00
Paulus Schoutsen 257743facc script/bootstrap_server 2015-12-17 09:17:24 -08:00
Paulus Schoutsen 0369f5153e Disable pychromecast in requirements all because protobuf dep fails on CI 2015-12-17 09:16:36 -08:00
Paulus Schoutsen 04aa4ff3a8 Add Travis fast_finish 2015-12-17 09:15:56 -08:00
Paulus Schoutsen 38c529502d Fix requirements_all.txt 2015-12-17 09:10:19 -08:00
Paulus Schoutsen dbad01f73d Merge pull request #767 from fabaff/binary-rest-sensor
Binary REST sensor
2015-12-17 09:05:44 -08:00
Paulus Schoutsen 9087e6a0d0 Merge pull request #765 from philipbl/template_automation
Add template automation
2015-12-17 09:01:08 -08:00
Paulus Schoutsen faff14ac94 Merge pull request #755 from molobrakos/eliqonline
Added support for ELIQ Online energy monitoring device (http://eliq.se/en/)
2015-12-17 08:56:13 -08:00
Paulus Schoutsen f2aeb2a6f9 Merge pull request #748 from davidedmundson/fuzzy
Use fuzzy matching for conversation entity matching
2015-12-17 08:55:12 -08:00
Philip Lundrigan 56b38e64ae Change method of listening to state changes 2015-12-16 23:53:10 -07:00
Paulus Schoutsen eb4f0e4ae9 Merge pull request #747 from w1ll1am23/dev
Added support for the Quirky Egg Minder
2015-12-16 20:08:00 -08:00
William Scanlon 1747db1888 More spacing fixes 2015-12-16 22:45:58 -05:00
William Scanlon 5066e6a183 Fixed spacing in wink 2015-12-16 22:39:02 -05:00
William Scanlon 8eb73c8f17 Fixed style violations 2015-12-16 22:31:34 -05:00
William Scanlon 3ce6463af3 Fixed python-wink in requirements_all.txt 2015-12-16 22:07:29 -05:00
William Scanlon cceb79a378 Pulled from dev to get up-to-date 2015-12-16 19:00:06 -05:00
Fabian Affolter 2a30c07429 Add binary rest sensor 2015-12-17 00:47:37 +01:00
Fabian Affolter f246508c9a Add binary rest sensor 2015-12-17 00:47:12 +01:00
William Scanlon eb6b4218fc Moved python-wink requirement to PyPI 2015-12-16 18:39:23 -05:00
Tom Duijf 7fb5927ac8 Merge pull request #766 from balloob/import_fixes
Import fixes for wink and heatmiser
2015-12-16 23:51:15 +01:00
Tom Duijf 4eec89b35e fixed my own cleanup 2015-12-16 22:36:40 +00:00
Philip Lundrigan 4c33eba378 Prevent triggering twice 2015-12-16 15:24:09 -07:00
Philip Lundrigan fe2ae16210 Add tests for template automation 2015-12-16 15:24:09 -07:00
Philip Lundrigan ab8ff42cdd Create template automation 2015-12-16 15:24:09 -07:00
Tom Duijf 687ce64551 small cleanup heatmiser 2015-12-16 22:21:32 +00:00
Tom Duijf 31b4c8eb4d Fixed imports 2015-12-16 21:52:49 +00:00
William Scanlon f6d16ba118 updated python-wink requirements for 3.0.1 2015-12-16 15:22:38 -05:00
Erik 69d8b995d4 added eliqonline 2015-12-16 20:54:25 +01:00
Erik 70bc6f4506 added eliqonline 2015-12-16 20:54:11 +01:00
William Scanlon afbf377b6d Update for style changes in python-wink 2015-12-16 13:32:38 -05:00
Fabian Affolter da63800319 Add gen_requirements_all.py 2015-12-16 19:20:44 +01:00
Erik 0075752c06 better error message 2015-12-16 18:11:44 +01:00
Paulus Schoutsen 0a44750441 Merge pull request #757 from fabaff/glances-name
Include name
2015-12-16 08:10:34 -08:00
William Scanlon c91cd9aa84 Updated python-wink requirements 2015-12-16 11:05:18 -05:00
Paulus Schoutsen c8234ffb8d Merge pull request #762 from bradsk88/pywink-0.3
Updating to python-wink 0.3.0
2015-12-16 07:50:35 -08:00
Erik 14056951c7 lint 2015-12-16 16:41:34 +01:00
Erik e76defe035 proper access_token check 2015-12-16 16:36:56 +01:00
Erik 3b8c5d6833 disable throttling for now 2015-12-16 16:36:04 +01:00
Erik 956a6418cc let the user supply the sensor name 2015-12-16 16:35:35 +01:00
Paulus Schoutsen 507145e954 Merge pull request #726 from happyleavesaoc/twitch
twitch sensor
2015-12-15 19:59:12 -08:00
Paulus Schoutsen 40c2e10756 Merge pull request #760 from kevinpanaro/dev
update pyicloud version for icloud tracker
2015-12-15 19:57:20 -08:00
bradsk88 58988787ea Updating to python-wink 0.3.0 2015-12-15 21:46:54 -06:00
kevinpanaro 79a1ffac9c fixed pyicloud version 2015-12-15 21:13:45 -05:00
kevinpanaro 4f6243fe0e changed pyicloud version to 0.7.2 2015-12-15 21:07:34 -05:00
happyleaves 2a3e086410 fix requirements comment 2015-12-15 20:44:55 -05:00
happyleaves 0e9c51a479 twitch sensor 2015-12-15 20:43:14 -05:00
Paulus Schoutsen d6dad8c818 Merge pull request #756 from philipbl/arest_sensor
Template support for aRest sensor
2015-12-15 16:48:14 -08:00
Paulus Schoutsen 17940f36e8 Merge pull request #759 from happyleavesaoc/orvibo_version
bump orvibo dependency version
2015-12-15 16:44:38 -08:00
happyleaves 149449624e bump orvibo dependency version 2015-12-15 18:50:15 -05:00
Philip Lundrigan 574de3b1b6 Handle template error
To be more consistent with the other sensor implementations of templates
2015-12-15 15:47:35 -07:00
Fabian Affolter 85873390ee Include name (#654) 2015-12-15 23:12:43 +01:00
Philip Lundrigan 4e6b01b0b9 Use different render method 2015-12-15 14:47:25 -07:00
Philip Lundrigan 5ecdd06bd5 Template support for arest sensor 2015-12-15 14:16:52 -07:00
Paulus Schoutsen 9404636536 Merge pull request #754 from davidedmundson/shebang
Add shebang line to setup.py
2015-12-15 13:06:13 -08:00
Erik a764817ee9 lint ok 2015-12-15 22:05:55 +01:00
Erik dade33187f added support for eliq online energy sensor 2015-12-15 21:48:42 +01:00
David Edmundson b3c13747dc Add shebang line to setup.py 2015-12-15 20:48:10 +00:00
David Edmundson a3f805d88e Use fuzzy matching for conversation entity matching
Entity may not be picked up exactly by the speech recognition. Instead
of doing an exact string match, look for names which are phonetically
similar and choose the best match above a certain threshold.

This helps as entity names may often be pronoun's (Dave's bedroom) and
this allows for some minor mistakes i.e "the bedroom" will successfully
match against a switch called "bedroom"

It introduces a new library dependency, fuzzywuzzy for comparisons.
2015-12-15 20:44:35 +00:00
Philip Lundrigan 66fca475c6 Merge pull request #745 from philipbl/numeric_trigger
Template support for numeric state
2015-12-15 10:18:22 -07:00
Philip Lundrigan 9fa8b27d65 Change from value to state 2015-12-15 10:12:43 -07:00
Philip Lundrigan 455a9c83a6 Simplify logic 2015-12-15 08:57:30 -07:00
William Scanlon 94eb002b0a Updated python-wink requirements and URL 2015-12-15 10:32:20 -05:00
Fabian Affolter fcdaa923c5 Update docstrings 2015-12-15 10:42:05 +01:00
Paulus Schoutsen a35dcf860e Update frontend with layout bugfix 2015-12-14 23:53:32 -08:00
Paulus Schoutsen 4029d149fb Weird travis fix for api 2015-12-14 23:27:22 -08:00
Paulus Schoutsen 027b891052 Add tests for API.stream 2015-12-14 23:20:43 -08:00
Paulus Schoutsen 2e0042adb0 Tweak iCloud device tracker 2015-12-14 21:39:48 -08:00
Paulus Schoutsen 79c92cd0c4 Merge branch 'pr/616' into dev 2015-12-14 21:31:20 -08:00
Paulus Schoutsen 946f6cab9d Merge pull request #743 from philipbl/command_sensor
Command Sensor: Add support for template
2015-12-14 18:51:35 -08:00
Paulus Schoutsen 9e0d19df6c Merge pull request #744 from fabaff/binary-sensor-template
Template support for binary sensor
2015-12-14 18:50:41 -08:00
Paulus Schoutsen 6d38288411 Merge pull request #746 from davidedmundson/dev
Add PlayMedia support to Chromecast component
2015-12-14 18:49:27 -08:00
William Scanlon 056645fe13 Removed files.txt 2015-12-14 19:08:45 -05:00
David Edmundson d16526739c Add PlayMedia support to Chromecast 2015-12-14 23:53:46 +00:00
William Scanlon 6a4442cddf Set REQUIREMENTS back to master 2015-12-14 18:34:11 -05:00
William Scanlon c1d728ce00 Remove @property from update function 2015-12-14 18:31:09 -05:00
Philip Lundrigan a517784c9e Condense in_range template logic 2015-12-14 15:07:35 -07:00
Philip Lundrigan 91a945f4c7 Slight style change 2015-12-14 15:01:38 -07:00
Philip Lundrigan cec62bdf87 Add tests 2015-12-14 14:47:32 -07:00
Philip Lundrigan 53239387e0 Add support for template 2015-12-14 14:47:24 -07:00
Fabian Affolter a1009d9138 Add template support 2015-12-14 21:38:56 +01:00
Philip Lundrigan e821b546d5 Ignore template if it isn't set 2015-12-14 10:49:54 -07:00
Philip Lundrigan 600831cff5 Add support for template 2015-12-14 10:29:27 -07:00
Fabian Affolter 87d40f6673 Move config details to doc 2015-12-14 18:19:50 +01:00
William Scanlon 5755c6f593 Fixed get method name 2015-12-14 10:45:03 -05:00
William Scanlon 3ed69cec68 Add Egg Minder support 2015-12-14 10:13:51 -05:00
Paulus Schoutsen df24a1bfa7 Update frontend (babel 6) 2015-12-13 23:59:40 -08:00
Paulus Schoutsen 90f0632a69 Install bower dependencies on frontend bootstrap 2015-12-13 23:54:15 -08:00
Paulus Schoutsen 3faa1a4393 Fix lint issues 2015-12-13 13:47:05 -08:00
Paulus Schoutsen f93d6a1a11 Fix local dir config path 2015-12-13 13:40:42 -08:00
Paulus Schoutsen 0f777ecd4c Update coveragerc 2015-12-13 13:21:38 -08:00
caius cc962c6bb2 Add some lint suggested modifications 2015-12-13 13:20:52 -08:00
caius 9833b4b663 Add the fritz device tracker to track established connections to FritzBox routers 2015-12-13 13:20:52 -08:00
caius b3171c7cde Add fritzconnection library to requirements 2015-12-13 13:20:52 -08:00
Paulus Schoutsen 4528c57539 Merge pull request #739 from balloob/alexa
Amazon Echo / Alexa support for retrieving information
2015-12-13 13:16:40 -08:00
Paulus Schoutsen 7e9eaf14b8 Merge pull request #740 from Mosibi/mpd_show_name_and_title
Added support for MPD to display the name before the title if it is available
2015-12-13 11:52:54 -08:00
Richard Arends 035d518cb6 Expect the case where currentsong['name'] can be absent. Use the .get
funtion with a default value set to None
2015-12-13 19:54:10 +01:00
Richard Arends 85b62a20c8 Use format instead of str.join to join name and title 2015-12-13 19:46:17 +01:00
Richard Arends 46f742f82f Added support for MPD to display the name before the title if it is available
When using a radio stream, the name of the station is often available in
currentsong['name']. Just like the 'mpc' CLI client, this change displays
the name of the station before the current song title.

For example: "Mick Jagger - Let's Work" becomes "Radio 10: Mick Jagger - Let's Work"
2015-12-13 18:42:53 +01:00
Paulus Schoutsen 729c24d59b Add Alexa component 2015-12-12 22:29:02 -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 931f7e8615 Simplify http component 2015-12-12 22:18:38 -08:00
Paulus Schoutsen 106a229a27 Merge pull request #724 from fabaff/dweet
Dweet.io sensor
2015-12-12 16:35:09 -08:00
Fabian Affolter 649ce7befb Fix typo 2015-12-13 01:00:34 +01:00
Fabian Affolter ed9b75756a Catch error state 2015-12-13 01:00:12 +01:00
Fabian Affolter 27c5c1cb9f Add dweepy 2015-12-12 22:58:08 +01:00
Fabian Affolter 1d017beb93 Use templating 2015-12-12 22:55:59 +01:00
Fabian Affolter 4286e116f3 Add requirement 2015-12-12 22:55:35 +01:00
Fabian Affolter 64e3db2444 Add dweet sensor 2015-12-12 22:55:35 +01:00
Fabian Affolter f458484770 Add sensor for Dweet.io 2015-12-12 22:55:35 +01:00
Paulus Schoutsen 01c4038dec Merge pull request #732 from philipbl/sensor_template
Add template support for rest sensor
2015-12-12 13:26:15 -08:00
Philip Lundrigan 27e3e72211 Change description of rest sensor 2015-12-12 14:19:00 -07:00
Philip Lundrigan a84ff14b00 Remove exception handling for templates
It is now handled in the layers below
2015-12-12 13:34:21 -07:00
Philip Lundrigan ab9ab532c8 Merge dev into sensor_template 2015-12-12 13:25:04 -07:00
Paulus Schoutsen 9fc0d93e44 Merge pull request #736 from Mosibi/mpd-add-state_on
Added support for MPD to start playing the current song/playlist
2015-12-12 12:06:38 -08:00
Paulus Schoutsen ded99d7480 Merge pull request #734 from balloob/template-errors
Catch exceptions when errors rendering template
2015-12-12 11:58:38 -08:00
Paulus Schoutsen 2b975c8620 Add flexible error value for value template parsing 2015-12-12 10:35:15 -08:00
Richard Arends 9eea7a6cde Added support for MPD to start playing the current song/playlist 2015-12-12 16:25:56 +01: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 0b325b2b7d API.stream - catch more errors 2015-12-11 18:43:00 -08:00
Philip Lundrigan 1c54111018 Add template support to rest sensor 2015-12-11 15:19:49 -07:00
Paulus Schoutsen 13b0d2afa3 Merge pull request #729 from mchrisb03/dev
Correct target temp for ecobee in heat or cool mode
2015-12-11 08:48:03 -08:00
Paulus Schoutsen a10908e167 Merge pull request #727 from andylockran/dev
Heatmiser Thermostat Support
2015-12-11 08:44:27 -08:00
Paulus Schoutsen 56bb9f2da0 Merge pull request #720 from balloob/template
Home Assistant templates
2015-12-11 08:32:49 -08:00
Chris Baumgartner 2368e5f4ec The target temp (shown in Thermostat card) is not correct when running in heat or cool modes. It is ok for auto mode. 2015-12-11 09:47:28 -06:00
andylockran 84226b573e Merge branch 'dev' of github.com:andylockran/home-assistant into dev 2015-12-11 12:49:34 +00:00
andylockran e19af76c70 Added heatmiser thermostat support 2015-12-11 12:45:27 +00:00
Paulus Schoutsen 9a9ecb5916 Migrate MQTT from jsonpath to templates 2015-12-10 21:39:01 -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 5f8fc7e197 Merge pull request #721 from MartinHjelmare/fix-logging-levels
Fix logging lowest level
2015-12-10 20:57:59 -08:00
Paulus Schoutsen 0dcc69d800 Fix template rounding 2015-12-10 20:47:06 -08:00
Paulus Schoutsen 47b5fbfaf3 Add template API endpoint 2015-12-10 20:47:06 -08:00
Paulus Schoutsen d1383ac94d Add template parsing to notify 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 b440c260e6 Add jinja2 to dependencies. 2015-12-10 20:47:05 -08:00
Paulus Schoutsen de68d3355a Add template support 2015-12-10 20:47:05 -08:00
Paulus Schoutsen fc8c26005c Change Travis caching to be less invasive 2015-12-10 18:16:49 -08:00
Paulus Schoutsen 452348a7f9 Update default MySensor persistence file path 2015-12-10 18:13:06 -08:00
happyleaves d3a21bee82 twitch media player 2015-12-10 20:52:36 -05:00
MartinHjelmare 5ff6eb8b9c Fix logging lowest level
* Set lowest logging level to NOTSET in enable_logging(), bootstrap.py,
	to enable setting a lower logging level than INFO in the logger
	component.
2015-12-10 02:56:05 +01:00
Paulus Schoutsen 5d3d2d4110 Merge pull request #719 from philipbl/decimal_places
Decimal places
2015-12-09 15:23:17 -08:00
Philip Lundrigan 3938b9f3f6 If decimal_places is 0, cast to int after rounding 2015-12-09 15:16:42 -07:00
Fabian Affolter 48593c6a68 Add docstrings 2015-12-09 08:24:12 +01:00
MartinHjelmare 1e52d5c7f2 Add S_TYPES to platform type and fix persistence
* Add S_TYPES to platform type.
* Fix persistence update on startup.
* Clean up code.
2015-12-09 04:43:18 +01:00
Philip Lundrigan d84bea3621 Allow decimal place to be used without corr factor 2015-12-08 16:15:19 -07:00
Paulus Schoutsen 9e41c495fc Update SW: Fix caching bug 2015-12-08 09:10:06 -08:00
Paulus Schoutsen c423a51315 Merge pull request #712 from fabaff/forecast
Return numerical value
2015-12-08 07:55:21 -08:00
Fabian Affolter 9f396b44f7 Return numerical value 2015-12-08 10:10:32 +01:00
Paulus Schoutsen ee339cfb20 Merge pull request #711 from balloob/service-worker
Initial service worker support
2015-12-07 23:50:12 -08:00
Paulus Schoutsen fe485cc27d Initial service worker support 2015-12-07 23:43:28 -08:00
Paulus Schoutsen e1990e07c7 Conditionally load webcomponents polyfill 2015-12-07 20:12:07 -08:00
MartinHjelmare 9463c84603 Clean up 2015-12-08 02:47:15 +01:00
MartinHjelmare 7cc707f1ce Fix docstrings to conform to pep 2015-12-08 01:03:07 +01:00
Fabian Affolter 0d4f681a4e Fix initialization error and update var name 2015-12-07 14:28:24 +01:00
Fabian Affolter e60dce9712 Update docstrings (influx -> influxdb) 2015-12-07 07:33:07 +01:00
Paulus Schoutsen aff82da611 Version bump to 0.10.0.dev0 2015-12-06 21:19:20 -08:00
Paulus Schoutsen 2c157e6885 Merge pull request #706 from balloob/dev
0.9.1
2015-12-06 21:18:57 -08:00
Paulus Schoutsen aaca0a64cb Version bump to 0.9.1 2015-12-06 21:16:23 -08:00
Paulus Schoutsen 48c3bbd5ac Update version frontend 2015-12-06 21:11:17 -08:00
Paulus Schoutsen 39e3a3c463 Bugfix: Allow accessing API via api_password in url 2015-12-06 21:09:49 -08:00
Paulus Schoutsen fd9da7f9de Merge pull request #705 from balloob/ssl-for-ha
SSL support for ha
2015-12-06 21:05:25 -08:00
Paulus Schoutsen 98467d0d9f Correct HTTP start log message 2015-12-06 15:13:41 -08:00
Paulus Schoutsen 832674286b Update the http log message with correct url 2015-12-06 14:42:08 -08:00
Paulus Schoutsen 9d8e077acc Add support for keys to HTTP component 2015-12-06 14:19:25 -08:00
Paulus Schoutsen b33e9fe6d9 Update API object to support SSL 2015-12-06 14:13:35 -08:00
Paulus Schoutsen f4238ca242 Add SSL support to HA 2015-12-06 14:05:58 -08:00
Paulus Schoutsen 301194034e Rename influx to influxdb 2015-12-06 13:11:37 -08:00
Paulus Schoutsen b8de2c5ebf Version bump to 0.10.0.dev0 2015-12-06 11:45:23 -08:00
Paulus Schoutsen 527d30ae4a Merge pull request #680 from balloob/dev
Version 0.9.0
2015-12-06 11:45:08 -08:00
Paulus Schoutsen 535a3c399e Version bump to 0.9.0 2015-12-06 11:44:38 -08:00
Paulus Schoutsen e0c4c8d7dd Remove unused constant in HTTP 2015-12-06 11:41:43 -08:00
Paulus Schoutsen d9b8ab8851 Update frontend 2015-12-06 11:34:53 -08:00
Paulus Schoutsen b2ae365558 Scripts call services in blocking manner 2015-12-06 11:03:31 -08:00
Paulus Schoutsen 1cb4d40bbb Update frontend 2015-12-06 10:00:10 -08:00
Paulus Schoutsen b7712ac682 Clean up influx component 2015-12-06 09:45:58 -08:00
Paulus Schoutsen a833e8b413 Update requirements_all.txt 2015-12-06 09:38:49 -08:00
Paulus Schoutsen e112620b2d Merge pull request #648 from fabaff/influx
Influx component
2015-12-06 09:38:13 -08:00
Paulus Schoutsen 934b097bc7 Rename date_util to dt_util
Follows the rest of Home Assistant
2015-12-06 09:12:36 -08:00
Paulus Schoutsen f8668075d0 Fix State.copy() 2015-12-06 09:12:36 -08:00
Paulus Schoutsen 03962ab6ae Fix demo component messing up the config
Could cause HTTP to be initialised in production mode.
2015-12-06 09:12:35 -08:00
Paulus Schoutsen facbbabe58 Merge pull request #700 from nkgilley/ecobee
point ecobee to latest api
2015-12-06 08:58:57 -08:00
MartinHjelmare 59524c7933 Add multiple gateways
* Add support for multiple serial gateways.
* Fix serialization of python objects by adding dict representation of
    classes.
* Add support for showing more than one child value type per entity.
    The entity state is always only one value type. This is defined by
    the platform value types. Value types that are not defined as the
    platform value type are shown as state_attributes.
* Add more unit of measurement types.
* Clean up code.
2015-12-06 00:29:03 +01:00
MartinHjelmare 1d141566bd Merge 'dev' into mysensors-component-switch 2015-12-05 23:55:36 +01:00
Paulus Schoutsen c4fe480b7b HTTP will not fail if no config 2015-12-05 13:44:50 -08:00
Paulus Schoutsen 705e3e4fbb Update material design icons 2015-12-05 13:20:00 -08:00
Paulus Schoutsen eefa62748b Update frontend 2015-12-05 01:12:58 -08:00
Paulus Schoutsen be14499bca Add rollershutter demo 2015-12-05 01:12:38 -08:00
nkgilley@gmail.com f582137fe3 point ecobee to latest api which has been cleaned up a bit. 2015-12-04 14:17:12 -05:00
Daren Lord 254889e3fd Fixing logging for pylint 2015-12-04 09:23:05 -07:00
Daren Lord 9ecc08c0c8 Adding in pyicloud to requirements_all.txt 2015-12-04 09:19:16 -07:00
Daren Lord e3d4e3ad4d Increasing scan interval. Moved imports. 2015-12-04 09:08:46 -07:00
Daren Lord b6342ed848 Merge branch 'dev' of https://github.com/balloob/home-assistant into findiphone 2015-12-04 09:05:23 -07:00
Fabian Affolter 0383dddae7 Remove dependency 2015-12-04 16:25:34 +01:00
Daniel Hoyer Iversen ac41f3028c Refactor yr sensor 2015-12-04 15:10:26 +01:00
Daniel Hoyer Iversen 750ca79ac0 Refactor yr sensor 2015-12-04 15:05:23 +01:00
Paulus Schoutsen d0ae22428d Merge pull request #695 from nkgilley/ecobee
Improve ecobee support for multiple thermostats
2015-12-03 13:25:08 -08:00
nkgilley@gmail.com 107994f3ac implement logic improvement suggestion by @balloob 2015-12-03 08:57:28 -05:00
Paulus Schoutsen 853aa2ac42 Merge pull request #692 from sfam/dev
Rename motor component back to rollershutter
2015-12-03 01:19:03 -08:00
nkgilley@gmail.com 7985468aba remove the use of unnecessary dictionary. 2015-12-02 17:42:53 -05:00
nkgilley@gmail.com 502184812d fix flake8 warnings 2015-12-02 16:37:16 -05:00
nkgilley@gmail.com 02a8ce71d0 fix req_all 2015-12-02 16:32:28 -05:00
nkgilley@gmail.com 08de7d954a improve support for multiple thermostats. 2015-12-02 16:22:25 -05:00
Daniel Hoyer Iversen 71bf707bcf fix tests in yr sensor 2015-12-02 13:32:52 +01:00
sfam 9d8865ad4d adjust rollershutter after rename 2015-12-02 12:18:49 +00:00
sfam c3f0d618be change constant names for rollershutter services 2015-12-02 12:16:13 +00:00
sfam 21ee621aec rename motor component back to rollershutter 2015-12-02 12:15:00 +00:00
Daniel Hoyer Iversen 31f1e1d7a4 added comment for yr sensor 2015-12-02 13:04:23 +01:00
Paulus Schoutsen dd0424435a Merge branch 'heatcontroll_config' into dev 2015-12-01 23:34:30 -08:00
Paulus Schoutsen 0555294afe Remove Hue transition time limit 2015-12-01 23:33:55 -08:00
Paulus Schoutsen 28bbf39155 Fix ISY994 hidden property 2015-12-01 23:33:55 -08:00
Jeff Schroeder 587ef04560 Merge pull request #686 from balloob/sonos-fix
Have Sonos work nicer with discovery
2015-12-01 22:44:58 -06:00
Paulus Schoutsen 38f28fe24b Merge pull request #691 from watchforstock/dev
Adding Honeywell Evohome support
2015-12-01 20:08:51 -08:00
Andrew Stock 1ce81ee6db Fixing exception 2015-12-01 21:30:44 +00:00
Andrew Stock 228142e497 Adding Honeywell Evohome support 2015-12-01 21:23:28 +00:00
Daniel Høyer Iversen 361ab0f92b Update yr.py 2015-12-01 20:19:59 +01:00
Daniel Høyer Iversen e68a8f9c0f Update yr.py 2015-12-01 20:16:04 +01:00
Daniel Høyer Iversen 15770ff90f Update yr.py 2015-12-01 20:12:07 +01:00
Daniel Hoyer Iversen 618ebfe43c try to fix requirements for yr sensor 2015-12-01 13:40:26 +01:00
Daniel Hoyer Iversen ff15fea9f8 Added units to sensor yr 2015-12-01 13:31:55 +01:00
Daniel Hoyer Iversen 2872c89f0c Fix in yr sensor 2015-12-01 13:24:32 +01:00
Daniel Hoyer Iversen 2dc9bc98f7 Tests for yr sensor 2015-12-01 13:24:03 +01:00
Daniel Hoyer Iversen 72d7e6e9dd Added requirements to yr sensor 2015-12-01 12:57:08 +01:00
Daniel Hoyer Iversen f912daf4b2 Updated yr sensor 2015-12-01 12:46:08 +01:00
Daniel Hoyer Iversen 9bd11205fb Merge branch 'heatcontroll_config' of https://github.com/balloob/home-assistant into heatcontroll_config 2015-12-01 11:09:47 +01:00
Daniel Hoyer Iversen 0025e67b05 Added test to heat control 2015-12-01 11:09:22 +01:00
Paulus Schoutsen 5e2641e288 Merge pull request #689 from happyleavesaoc/limitlessled_off_transition_fix
LimitlessLED off->off transition fix
2015-11-30 22:48:24 -08:00
happyleaves f173f8b88b fix #688 2015-11-30 18:47:04 -05:00
Daniel Hoyer Iversen d9fc2a8bf6 initial version of yr.no weather component 2015-11-30 17:00:28 +01:00
Daniel Høyer Iversen d6cac08be6 Update heat_control.py 2015-11-30 11:46:14 +01:00
Daniel Hoyer Iversen 2e89f0a8c7 style fix in heat control 2015-11-30 11:45:09 +01:00
Daniel Høyer Iversen 758c0aae24 Update heat_control.py 2015-11-30 10:32:32 +01:00
Daniel Høyer Iversen 8fee38f2cd style fix in heat control 2015-11-30 10:05:05 +01:00
Paulus Schoutsen 41ab635dcd Have Sonos work nicer with discovery 2015-11-30 00:55:36 -08:00
Paulus Schoutsen 48a424e86f Frontend upgrade 2015-11-30 00:48:58 -08:00
Paulus Schoutsen 6113988ccd Merge pull request #685 from balloob/python-3.5-travis
Update Travis to test on Python 3.5 too
2015-11-30 00:30:44 -08:00
Daniel Høyer Iversen 2732b20305 style fix in heatcontrol 2015-11-30 09:22:04 +01:00
Daniel Høyer Iversen ac59847120 Update heat_control.py 2015-11-30 09:14:32 +01:00
Paulus Schoutsen b53993e8c0 Update Travis to test on Python 3.5 too 2015-11-30 00:09:58 -08:00
Paulus Schoutsen 90eab17ea6 Fix MQTT light bugs 2015-11-29 23:23:27 -08:00
Paulus Schoutsen 5b4f607da1 Upgrade frontend with lock support 2015-11-29 22:49:54 -08:00
Paulus Schoutsen 72ebb22eba Update demo entities 2015-11-29 17:59:59 -08:00
Paulus Schoutsen dc2f3861c9 Merge remote-tracking branch 'fabaff/alarm-demo' into dev 2015-11-29 17:35:19 -08:00
Paulus Schoutsen 6a25af4a9f Merge pull request #671 from happyleavesaoc/limitlessled
limitlessled improvements
2015-11-29 16:26:22 -08:00
happyleaves 6e0c30d9f7 warn -> warning 2015-11-29 18:29:37 -05:00
happyleaves 022d6af6fc Merge branch 'limitlessled' of https://github.com/happyleavesaoc/home-assistant into limitlessled 2015-11-29 17:52:42 -05:00
happyleaves 32003daf3f refactor legacy; move imports 2015-11-29 17:15:06 -05:00
happyleaves 5fba67f6c3 limitlessled improvements 2015-11-29 17:15:06 -05:00
Paulus Schoutsen a3981be501 Merge pull request #681 from pavoni/add_solar_elevation
Add automations based on Solar Elevation
2015-11-29 14:14:26 -08:00
Paulus Schoutsen 343b5bd2b8 Merge pull request #682 from happyleavesaoc/s20-update
Orvibo updates
2015-11-29 14:13:31 -08:00
Paulus Schoutsen 35f1810c74 Merge pull request #683 from balloob/pylint-15-fixes
PyLint 1.5 fixes
2015-11-29 14:11:35 -08:00
Paulus Schoutsen 7ba9fb90f1 More PyLint fixes 2015-11-29 14:04:44 -08:00
Paulus Schoutsen 5023772b3e Fix gen_requirements_all.py and add updated requirements_all.txt 2015-11-29 13:58:14 -08:00
Paulus Schoutsen ee805ec145 Merge remote-tracking branch 'fabaff/gen-requirements' into pylint-15-fixes 2015-11-29 13:49:19 -08:00
Paulus Schoutsen a301d869d7 PyLint 1.5 fixes 2015-11-29 13:49:05 -08:00
pavoni cb0eb2df7d Add tests 2015-11-29 21:37:08 +00:00
happyleaves 18ca7b4f9e bump requirement version; support multiple switches per platform 2015-11-29 15:52:16 -05:00
pavoni aff1c27372 Remove unused and potentially confusing property 2015-11-29 20:45:03 +00:00
Paulus Schoutsen 01203c7c4c Add updater tests 2015-11-29 12:13:06 -08:00
Paulus Schoutsen 8841eef2b7 Add tests for lock component 2015-11-29 11:44:27 -08:00
happyleaves 52b39efc51 Merge branch 'dev' of https://github.com/balloob/home-assistant into limitlessled 2015-11-29 12:44:44 -05:00
Fabian Affolter 7d503e3f8b Update docstrings 2015-11-29 15:52:44 +01:00
pavoni 73e3ce5044 Fix bug 2015-11-29 12:18:54 +00:00
pavoni f4c3fbe8fd Add attribuet config to numeric state platform to allow trigger based in attributes rather than states. 2015-11-29 11:56:47 +00:00
pavoni 41a0f2c198 Add elevation attribute 2015-11-29 10:47:20 +00:00
Paulus Schoutsen 0016ff6acc Merge pull request #678 from balloob/mqtt-light
Fixes for MQTT light with RGB colors
2015-11-28 23:22:57 -08:00
Paulus Schoutsen 45bd371cbf Merge pull request #679 from balloob/bugfixes
Bugfixes
2015-11-28 23:22:33 -08:00
Paulus Schoutsen 70698f7ab0 Update demo camera images 2015-11-28 23:16:20 -08:00
Paulus Schoutsen 286299c4c9 update frontend 2015-11-28 22:19:34 -08:00
Paulus Schoutsen f76edf0ed9 Tweak manifest and frontend index 2015-11-28 22:15:11 -08:00
Paulus Schoutsen 733de6b357 Streaming API will keep session alive 2015-11-28 22:14:40 -08:00
Paulus Schoutsen e67732b4f8 Remove no longer needed image 2015-11-28 19:12:42 -08:00
Paulus Schoutsen 546377e80a Throttle camera stream to 2fps 2015-11-28 18:59:59 -08:00
Paulus Schoutsen 0df39b4df5 Remove no password set boolean 2015-11-28 18:32:15 -08:00
Paulus Schoutsen 64ebe8c6d0 Update frontend splash screen 2015-11-28 18:20:17 -08:00
Paulus Schoutsen 78cfed1fb0 Clean up HTTP sessions and allow log out 2015-11-28 17:18:35 -08:00
Paulus Schoutsen 99aa4307ef Add locks to entity component 2015-11-28 15:55:01 -08:00
Paulus Schoutsen ef394b8af7 Pushbullet tweaks 2015-11-28 15:41:30 -08:00
Daniel Høyer Iversen aebab47fff Update tellstick.py 2015-11-28 23:30:12 +01:00
Daniel Høyer Iversen f2d553bfd1 Update tellstick.py 2015-11-28 23:28:17 +01:00
Paulus Schoutsen e84ef2d2d7 API to fetch Error log is no longer cached. 2015-11-28 14:08:01 -08:00
Paulus Schoutsen 957b09707d Fixes for MQTT light with RGB colors 2015-11-28 12:46:35 -08:00
Paulus Schoutsen 9ecfc41e09 Merge pull request #677 from theseal/legacy_nmap
Support for legacy nmap.
2015-11-28 11:47:48 -08:00
Paulus Schoutsen 194e7f8811 Merge pull request #676 from balloob/tellstick_light
Added signal repetitions to tellstick light
2015-11-28 11:43:55 -08:00
Johan Carlquist 6a021c9ef6 Support for legacy nmap.
Older nmap like the one bundled with Ubuntu Precise (12.04), 5.21
requires that you specify what unit the value to --host-timeout is.
2015-11-28 20:43:27 +01:00
Daniel Hoyer Iversen b6d7cacc61 Added signal repetitions to tellstick light 2015-11-28 20:39:48 +01:00
happyleaves e6fdcc94e6 refactor legacy; move imports 2015-11-28 12:21:00 -05:00
Paulus Schoutsen 05978ad88d Update discovery component to netdisco 0.5.2 2015-11-28 01:36:42 -08:00
Paulus Schoutsen 1146d6e58d Allow thermostat temperatures with decimal numbers 2015-11-28 01:18:02 -08:00
Paulus Schoutsen 6809a881fa Tweak MQTT Motor component 2015-11-28 01:02:35 -08:00
Paulus Schoutsen 9f01d7abca Merge branch 'pr/655' into dev 2015-11-28 00:55:22 -08:00
Paulus Schoutsen bbfeba0fe4 Merge branch 'pr/635' into dev
Conflicts:
	requirements_all.txt
2015-11-28 00:50:18 -08:00
Paulus Schoutsen ad3f96fa25 Merge pull request #672 from balloob/some-cleanup
Make component dependencies optional
2015-11-27 15:08:22 -08:00
happyleaves d91fe792c5 limitlessled improvements 2015-11-27 16:27:52 -05:00
Paulus Schoutsen 93c86ca5a1 Merge pull request #670 from pavoni/bump_pywemo
Bump pywemo version
2015-11-27 13:08:12 -08:00
pavoni bbf73e0bae Bump pywemo version - fixed scan device = None bug 2015-11-27 19:05:15 +00:00
Paulus Schoutsen 47eb4e76cf Merge pull request #669 from pavoni/handle-efergy_value_error
Trap and trace error rather than throwing exception when efergy server
2015-11-27 10:27:45 -08:00
Paulus Schoutsen ada612e09d Merge pull request #668 from pavoni/handle_vera_timeout
Add exception handler for vera timeout
2015-11-27 10:23:19 -08:00
pavoni 00f0dfb971 Trap and trace error rather than throwing exception when efergy server 2015-11-27 18:21:26 +00:00
pavoni 7204bc018f Add exception handler for vera timeout 2015-11-27 11:43:43 +00:00
Fabian Affolter 7224775aa8 Use manual alarm control panel as base for demo 2015-11-27 00:40:51 +01:00
Fabian Affolter 60460e8217 Add alarm control panel as platform and remove camera/acp entries 2015-11-27 00:18:11 +01:00
Fabian Affolter 67bcb00c9e Add demo platform for alarm control panel 2015-11-27 00:18:11 +01:00
Fabian Affolter 74b37bd61b Change to exception instead of error 2015-11-26 23:57:57 +01:00
Fabian Affolter 08da1e6f8d Add influx component 2015-11-26 23:57:34 +01:00
Paulus Schoutsen fabd0ced3f Make DEPENDENCIES optional for components 2015-11-26 13:11:59 -08:00
Paulus Schoutsen 2861bbb02c Warn if config invalid shape for script 2015-11-26 13:08:13 -08:00
Paulus Schoutsen 4c3d6981a6 Merge pull request #661 from bachp/mqtt-retain
Allow setting the retain flag for mqtt switch.
2015-11-26 12:19:52 -08:00
Pascal Bach 341c3a8fcd Fix tests for mqtt publish with retain. 2015-11-26 21:03:21 +01:00
Pascal Bach 69e9d39690 Allow setting the retain flag for mqtt switch.
Some devices can read the initial value on startup.
If the retain flag is set they always receive the value as last set by
home assistant.
2015-11-26 21:03:21 +01:00
Paulus Schoutsen 65f3e7ccf4 Merge pull request #652 from bachp/arest-function
Function support for aREST backend
2015-11-26 11:55:24 -08:00
Pascal Bach 067011af15 function support for aREST backend
The implementation sends /<name>?params=1 for turn_on and /<name>?params=0 for turn_off
It uses the return value of the function to determine the current state.
0=Off, 1=On
2015-11-26 20:45:07 +01:00
Paulus Schoutsen 271c2f6537 Merge pull request #664 from fabaff/mystrom-switch
myStrom switch
2015-11-26 09:43:55 -08:00
Fabian Affolter f2f598bd26 Use host as config var instead of resource 2015-11-26 16:37:00 +01:00
sfam 4f75286f64 fix some comments 2015-11-26 09:38:25 +00:00
Paulus Schoutsen c4d4dcccb7 Merge pull request #665 from badele/rfxtrx_event
Add should_fire_event in rfxtrx component
2015-11-25 23:40:39 -08:00
badele 128e3bb762 Move import module 2015-11-26 08:27:31 +01:00
badele a33220db7f Fix pylint style 2015-11-26 08:12:04 +01:00
badele 4bd0db30c9 Add should_fire_event in rfxtrx component 2015-11-26 07:52:37 +01:00
Fabian Affolter e60ab8f4c2 Add possibility to write data to file 2015-11-25 23:31:04 +01:00
Fabian Affolter 38b564e413 Remove class, just use state_changed, and update the export data 2015-11-25 22:49:32 +01:00
Fabian Affolter 76ac913fc0 Add influx component 2015-11-25 22:49:32 +01:00
sfam 0dbf4b3c10 add const.py changes to commit 2015-11-25 18:20:16 +00:00
sfam 08ba71a359 rename component to motor and services to open/close/stop 2015-11-25 18:13:39 +00:00
Fabian Affolter 1bebb17e9f Not need to raise exception 2015-11-25 18:14:19 +01:00
Fabian Affolter e45ef0013b Catch connection timeout 2015-11-25 18:07:29 +01:00
Fabian Affolter 9dfa4ea233 Add mystrom switch 2015-11-25 17:21:31 +01:00
Fabian Affolter a8ddae9343 Add myStrom switch platform 2015-11-25 17:21:11 +01:00
Fabian Affolter 3e60c4801c Update docstrings 2015-11-25 08:56:50 +01:00
Fabian Affolter bc106bcb10 Move configuration details to docs 2015-11-25 08:48:27 +01:00
Paulus Schoutsen 6f3cebdacf Merge pull request #657 from goir/thermostat_homematic
Added support for Homematic thermostat
2015-11-24 21:38:23 -08:00
Goir b0fa80ad4c Added support for Homematic thermostat 2015-11-24 21:23:12 +01:00
nkgilley@gmail.com 067b5862c0 bug fixes 2015-11-24 09:29:33 -05:00
sfam 351430c1b3 move current_position to RollershutterDevice class 2015-11-24 10:41:39 +00:00
sfam e001ea913a add __init__.py to test folder 2015-11-24 08:03:02 +00:00
Paulus Schoutsen 901b9075dc Merge pull request #658 from bachp/arest-logargs
Fix order of log arguments for arest switch
2015-11-23 20:53:39 -08:00
Paulus Schoutsen d141306493 Update Dockerfile to depend on Python 3.4 instead of latest 2015-11-23 20:42:32 -08:00
Paulus Schoutsen 6c12580b69 Merge pull request #659 from allanglen/improve-dockerfile
Re-order Dockerfile for faster rebuild on code changes
2015-11-23 20:42:08 -08:00
Pascal Bach 0d3a099926 arest: fix order argument order of log messages 2015-11-23 21:46:47 +01:00
Allan Glen 09a82dedf0 Re-order Dockerfile for faster rebuild on code changes 2015-11-23 11:58:59 -07:00
nkgilley@gmail.com 80e829f53a was getting errors for NETWORK being None. looked like it was being loaded too early, so this will wait until it's ready 2015-11-23 11:52:02 -05:00
nkgilley@gmail.com 27bc4c582b update network data before sensor setup. 2015-11-23 11:40:54 -05:00
nkgilley@gmail.com cc196d9888 fixed sensors and thermostat. discovery working for both now. 2015-11-23 11:15:19 -05:00
sfam 68ff9dd74f rollershutter component - fix const 2015-11-23 00:35:22 +00:00
sfam d4b3af327d Initial commit for rollershutter component 2015-11-23 00:25:10 +00:00
sfam 8269e843f2 Initial commit for rollershutter component 2015-11-23 00:22:43 +00:00
Paulus Schoutsen 7acb3dffe4 Merge pull request #653 from balloob/mqtt-disconnect
Reconnect when disconnected from MQTT
2015-11-22 16:08:30 -08:00
Paulus Schoutsen 1bda0bd73b Add some MQTT tests 2015-11-22 16:04:16 -08:00
Paulus Schoutsen f170799182 Reconnect when disconnected from MQTT 2015-11-22 15:19:51 -08:00
Paulus Schoutsen d4f0f0ffd3 Update automation url in warning 2015-11-22 15:10:24 -08:00
Paulus Schoutsen 7f1254d750 Merge pull request #647 from mcdeck/dev
Support for json messages in mqtt switches and sensors
2015-11-22 11:22:56 -08:00
Oliver van Porten 100400f149 move requirements to single line to not to affect coverage 2015-11-22 16:28:21 +01:00
Oliver van Porten 90681c2dc9 fix incorrect requirements 2015-11-22 16:19:08 +01:00
Oliver van Porten dbcd055cfe move import of jsonpath-rw to c'tor of _JsonFmtParser 2015-11-22 16:18:05 +01:00
Paulus Schoutsen d6feb82f9b Merge branch 'pr/634' into dev
Conflicts:
	requirements_all.txt
2015-11-21 23:22:47 -08:00
Paulus Schoutsen fc0e76764d Merge pull request #645 from fabaff/arest-binary-sensor
aREST binary sensor
2015-11-21 22:38:48 -08:00
Paulus Schoutsen 64c9619d75 Merge pull request #646 from fabaff/mqtt-binary-sensor
MQTT binary sensor
2015-11-21 22:31:17 -08:00
Daren Lord 8074854731 Fixing formatting 2015-11-21 21:12:41 -07:00
Daren Lord fff6b24449 Switching to new device scanner setup. 2015-11-21 21:04:28 -07:00
Daren Lord 396a65ab03 Merge branch 'dev' of https://github.com/balloob/home-assistant into findiphone 2015-11-21 15:26:44 -07:00
Paulus Schoutsen ee73bc9ad4 Merge pull request #642 from bburan/bburan/openzwave-config-fix
Fix issue with finding location of OpenZWave conf
2015-11-21 12:10:20 -08:00
nkgilley@gmail.com 8dc0de1d05 move EcobeeData class and Throttle to the main ecobee component, this way the sensor and thermostat will use the same throttled updating object. 2015-11-21 12:24:06 -05:00
Oliver van Porten 715abf241e Disable pylint warning for callable classes 2015-11-21 17:57:15 +01:00
miniconfig f37d0d1c20 Updated wink library version in requirements_all.txt 2015-11-21 09:52:43 -05:00
Brad Buran 0621260435 Fix issue with finding location of OpenZWave conf
Under some install scenarios, it may be possible that OpenZWave can't
automatically discover the location of the vendor-specific XML config
files. In this event, we need to specify the location in the Home
Assistant configuration.yaml file.
2015-11-20 19:47:29 -08:00
Oliver van Porten 427944cc44 add test for mqtt+json switch 2015-11-20 23:50:46 +01:00
Fabian Affolter 422a93e735 Add tests for MQTT binary sensor 2015-11-20 23:48:59 +01:00
Fabian Affolter b4ee3f73b4 Add aREST binary sensor and fix ordering 2015-11-20 23:47:49 +01:00
nkgilley@gmail.com 44abc31057 work in progress: configurator is now in it's own component. configurator seems to work but the thermostat is now broken. 2015-11-20 17:47:25 -05:00
Oliver van Porten 820b2a31b3 Add additional unit tests for mqtt state format parsing 2015-11-20 23:47:21 +01:00
Fabian Affolter 08d29d3630 Add MQTT binary sensor 2015-11-20 23:43:59 +01:00
Oliver van Porten 44714614ad Fix unit tests for mqtt 2015-11-20 23:42:22 +01:00
Fabian Affolter 065f4b7c20 Add binary sensor for aREST 2015-11-20 23:39:39 +01:00
Oliver van Porten 030686a978 fix flak8 warnings 2015-11-20 22:55:52 +01:00
Oliver van Porten 799043dc0a refactor format mqtt format parser 2015-11-20 22:45:09 +01:00
miniconfig 105dc2847e Changed locked method of lock support to "is_locked".
Added lock and unlock methods
Updated wink components to use the new version of the wink library.
2015-11-20 16:34:27 -05:00
Oliver van Porten b4cf0e874a Support parsing mqtt messages via jsonpath 2015-11-20 22:03:17 +01:00
Paulus Schoutsen 3df6c584c0 Update frontend 2015-11-20 08:38:56 -08:00
Paulus Schoutsen 3493db1052 Merge pull request #608 from fabaff/contact
Binary sensor component
2015-11-20 08:37:10 -08:00
Fabian Affolter d254e7e9e5 Fix pylint issue 2015-11-20 15:29:36 +01:00
Fabian Affolter 52344d65bc Merge branch 'contact' of github.com:fabaff/home-assistant into contact 2015-11-20 15:02:17 +01:00
Fabian Affolter a6006b1835 Move state 2015-11-20 14:59:21 +01:00
Fabian Affolter b9730e6914 Binary sensor component 2015-11-20 14:59:21 +01:00
Paulus Schoutsen 037bca041e Merge pull request #641 from balloob/pushbullet_email
Notify/pushbullet - adjustment in supported targets
2015-11-19 22:46:41 -08:00
Tom Duijf 77a1a1529c Added support for email, removed 'device/' hack to send to all own devices, as own email address does the same 2015-11-19 22:14:41 +00:00
miniconfig fa7391cdf6 Changed do_lock and do_unlock methods to lock and unlock.
Implemented state method.
Fixed locked method for demo interface.
Changed LockDevice to extend Entity instead of ToggleEntity
2015-11-19 16:54:55 -05:00
Paulus Schoutsen d25f58e650 Merge pull request #631 from balloob/gen-requirements_all
Allow generating requirements_all.txt
2015-11-19 12:49:23 -08:00
Paulus Schoutsen 6d315a1a7c Merge pull request #636 from fabaff/camera-demo
Camera demo
2015-11-19 12:11:12 -08:00
Fabian Affolter 685964785d Add camera to demos 2015-11-19 19:35:51 +01:00
Fabian Affolter ca32c81612 Camera demo 2015-11-19 19:27:28 +01:00
Fabian Affolter 5f89db5957 Binary sensor component 2015-11-19 19:00:22 +01:00
Fabian Affolter 4eacea32da Fix pylint issue 2015-11-19 18:07:54 +01:00
nkgilley@gmail.com d05af62680 use Throttle like the BitCoin component. 2015-11-18 14:57:27 -05:00
Fabian Affolter f1fed78992 Fix issue with older glances releases #637 (thanks @jdotbdot) 2015-11-18 19:19:27 +01:00
nkgilley@gmail.com 8df32aac3c point to updated python-ecobee library 2015-11-18 10:43:52 -05:00
nkgilley@gmail.com 18d0f4461f add config png to images dir. 2015-11-18 10:16:16 -05:00
nkgilley@gmail.com c6d1a4bdaf Fix configurator, rename repo, cleanup code. 2015-11-18 10:13:46 -05:00
Fabian Affolter ab9e173179 Update docstrings 2015-11-18 08:42:49 +01:00
Nolan Gilley 22fcbc67cf fix req 2015-11-17 19:20:56 -05:00
Nolan Gilley e317e0798b initial commit for ecobee thermostat component. 2015-11-17 19:14:29 -05:00
miniconfig c78899c4f3 Added support for Locks, including those connected through a wink hub. 2015-11-17 10:17:57 -05:00
Paulus Schoutsen bca65b620a Update Vera sensor dependency 2015-11-17 00:34:14 -08:00
Paulus Schoutsen e92fe149fe Comment out requirements that break on certain platforms 2015-11-17 00:30:13 -08:00
Paulus Schoutsen 377d2c6e5a Allow generating requirements_all.txt 2015-11-17 00:21:49 -08:00
Paulus Schoutsen 8be53af78f Convert README to RST format 2015-11-16 22:02:35 -08:00
Paulus Schoutsen 573dfb648f Version bump to 0.9.0.dev0 2015-11-16 00:03:37 -08:00
Paulus Schoutsen 8e44ed0090 Merge pull request #617 from balloob/dev
0.8.0.rc1
2015-11-16 00:03:20 -08:00
Paulus Schoutsen 5fb6076f6e Version bump to 0.8.0 2015-11-16 00:03:00 -08:00
Fabian Affolter 4ea6def1bd Update docstrings and link to docs 2015-11-16 07:53:31 +01:00
Paulus Schoutsen 314185ffb8 Merge pull request #629 from rmkraus/dev
Adding updater to default list of components
2015-11-15 17:30:15 -08:00
Ryan Kraus 8aafb89a64 Merge remote-tracking branch 'balloob/dev' into dev 2015-11-15 20:04:21 -05:00
Ryan Kraus d01ed9788f Added updater to set of default components 2015-11-15 20:03:45 -05:00
Paulus Schoutsen b4e2f4f0be Merge pull request #625 from balloob/enhancement_pushbullet
Enhancement: targeted notifications in pushbullet
2015-11-15 16:41:18 -08:00
Tom Duijf f4d8325084 Pushbullet; code cleanup & better errors on config typos 2015-11-16 00:29:04 +00:00
Tom Duijf cc5dec3c59 Processed feedback from PR comments 2015-11-15 23:46:16 +00:00
Ryan Kraus ec5a93a0fd Merge remote-tracking branch 'balloob/dev' into dev 2015-11-15 18:16:49 -05:00
Paulus Schoutsen aabda1b7b0 Merge pull request #628 from rmkraus/dev
Small tweaks to daemon management.
2015-11-15 14:46:58 -08:00
Tom Duijf aee4411cfb <type>.<name> split only on first separator 2015-11-15 22:44:51 +00:00
Ryan Kraus 135eb0a0ac Fixed hass daemon management
1) Changed signal to exit hass to SIGTERM
2) Updated initd script to send SIGTERM
3) Updated systemd script to never send SIGKILL.
2015-11-15 17:43:38 -05:00
Ryan Kraus 01daac066a Merge remote-tracking branch 'balloob/dev' into dev 2015-11-15 17:37:57 -05:00
Ryan Kraus 5d96ca133d Merge pull request #627 from rmkraus/update_notify
Updater component
2015-11-15 17:36:55 -05:00
Ryan Kraus 3cda1aacff Fixed typo in updater entity attributes.
Left some quotes in there. My bad.
2015-11-15 17:34:06 -05:00
Ryan Kraus 243130c133 Using ATTR_FRIENDLY_NAME in updater component. 2015-11-15 17:32:05 -05:00
Paulus Schoutsen 0d74b628b0 Merge pull request #623 from balloob/lib-clean-on-upgrade
Lib clean on upgrade
2015-11-15 14:30:51 -08:00
Ryan Kraus c314101dde Updater suggestions from Paulus
1) Moved error checking into get_newest_version function.
2) Fixed import formatting mistake.
2015-11-15 17:30:42 -05:00
Paulus Schoutsen 0f68dc6b7b Add tests for version upgrade 2015-11-15 14:28:50 -08:00
Ryan Kraus 919c20a263 Implemented suggestions from Paulus for updater
1) Better Error handling when making PyPI requests.
2) More efficient event scheduling.
3) ENTITY_ID in constant
3) friendly_name from constant
2015-11-15 17:23:56 -05:00
Ryan Kraus 9b5385c565 Merge remote-tracking branch 'balloob/dev' into update_notify
Conflicts:
	homeassistant/components/frontend/version.py
	homeassistant/components/frontend/www_static/frontend.html
2015-11-15 17:00:35 -05:00
Ryan Kraus 7dacf01baa Updating fronted to latest version. 2015-11-15 16:56:33 -05:00
Tom Duijf 9b4650afd4 Added comments 2015-11-15 20:49:42 +00:00
Tom Duijf 0b0fd2490d Pushbullet; styling, requirements, example 2015-11-15 19:14:10 +00:00
Tom Duijf 3a85bebbf6 pushbullet; styling and minor fixed before PR 2015-11-15 18:57:16 +00:00
Paulus Schoutsen 18f1de10a5 Merge pull request #624 from leoc/feature-zwave-meter-sensor
Add Zwave `meter` command class
2015-11-15 10:16:57 -08:00
Paulus Schoutsen 869d6df65e Merge pull request #618 from nkgilley/camera-fix
add exception handling to generic camera requests function.
2015-11-15 10:02:20 -08:00
Tom Duijf 0a586bd919 Initial commit of pushbullet enhancement 2015-11-15 17:50:36 +00:00
Fabian Affolter a98b1b0ebc Update link to docs 2015-11-15 18:50:06 +01:00
Paulus Schoutsen 511028612c Merge pull request #593 from leoc/feature-zwave-switches
Implement zwave switches
2015-11-15 09:30:06 -08:00
Paulus Schoutsen e3efce5ded Merge pull request #622 from happyleavesaoc/s20
s20 switch support
2015-11-15 09:28:40 -08:00
Arthur Andersen 340ee171b5 [Zwave] Add zwave polling interval configuration 2015-11-15 17:50:14 +01:00
Arthur Andersen 773da3f755 [Zwave] Add Meter command class 2015-11-15 17:50:11 +01:00
happyleaves 12bdc39274 don't update state in turn_on/off 2015-11-15 08:59:18 -05:00
Paulus Schoutsen 700b7ba591 Remove unused import in notify 2015-11-15 02:20:35 -08:00
Paulus Schoutsen 295f27d259 Only delete lib dir in config upgrade if exists 2015-11-15 02:16:52 -08:00
Ryan Kraus 4463b69245 Added friendly name to updater component. 2015-11-15 05:15:36 -05:00
Paulus Schoutsen 71e4283a2e Remove lib directory in version upgrade 2015-11-15 02:05:46 -08:00
Paulus Schoutsen 6135b87b1d Log error if unable to install package 2015-11-15 02:05:13 -08:00
Paulus Schoutsen 04bb7ed58f Have Notify platform install platform dependencies 2015-11-15 02:04:57 -08:00
Ryan Kraus dfa9880176 Created updater component 2015-11-15 05:00:24 -05:00
Paulus Schoutsen 88f3a5a50a Update to new version frontend 2015-11-15 00:51:12 -08:00
Paulus Schoutsen e2c530b85d Script: new attribute if can cancel 2015-11-14 15:38:07 -08:00
Arthur Andersen 56c5d345a4 [Zwave] Update HA state on value change 2015-11-14 23:14:08 +01:00
happyleaves 86b9ae9566 addressed comments 2015-11-14 16:14:25 -05:00
Nolan Gilley df264f2ec0 remove unnecessary else 2015-11-14 15:49:39 -05:00
happyleaves aabcad59d8 rename platform to orvibo 2015-11-14 15:05:22 -05:00
happyleaves 70fef3c5b5 fixed names 2015-11-14 14:25:53 -05:00
happyleaves 57ec58e255 fixed requirements 2015-11-14 14:19:47 -05:00
happyleaves cf8e23adbc s20 switch support 2015-11-14 14:14:02 -05:00
Paulus Schoutsen eabf9087f3 Merge pull request #621 from fabaff/cleanup-glances
Glances sensor cleanup
2015-11-14 10:51:57 -08:00
Nolan Gilley 9acb341b96 remove break 2015-11-14 10:51:07 -05:00
Fabian Affolter 5275ca9ce7 Fix typo 2015-11-14 15:25:52 +01:00
Fabian Affolter 646618a25e Improve error messages, use constants, and fix docstrings 2015-11-14 15:23:20 +01:00
Paulus Schoutsen bc48e4f98e Merge pull request #619 from nkgilley/mqtt-light-color-fix
Remove rgb color if it's not an rgb bulb.
2015-11-14 00:51:18 -08:00
Nolan Gilley 776324807e last PR was dumb. this fix is better. 2015-11-13 14:58:49 -05:00
Nolan Gilley d68a4b52f1 Remove rgb color if it's not an rgb bulb. 2015-11-13 14:32:47 -05:00
Nolan Gilley 85e0db6ade add exception handling to generic camera requests function. 2015-11-13 13:55:22 -05:00
Fabian Affolter d993f4014e Add link to docs 2015-11-13 08:29:54 +01:00
Paulus Schoutsen 7ebda9c3c6 Fix MQTT light test 2015-11-12 23:08:26 -08:00
Paulus Schoutsen 16e948d032 Merge branch 'pr/552' into dev 2015-11-12 23:04:05 -08:00
Paulus Schoutsen 41d0f95d9a Move core light test to correct dir 2015-11-12 23:03:56 -08:00
Paulus Schoutsen bfaaf39e9e Merge pull request #613 from Xorso/squeezebox_fix
Fixing bug when connecting to squeezebox and it is a float
2015-11-12 22:45:03 -08:00
Daren Lord c60bb35d4a Fixed lint errors 2015-11-12 23:40:30 -07:00
Daren Lord 90007a04d3 Adding iCloud device_tracker component. Allow to track devices registered with iCloud 2015-11-12 23:37:15 -07:00
Paulus Schoutsen 16904452b8 Merge pull request #614 from persandstrom/asuswrt_not_loading
ASUSWRT more logging and more robust
2015-11-12 11:43:49 -08:00
Per Sandström 158d9e27ff more robust and more logging 2015-11-12 20:10:25 +01:00
Fabian Affolter b652dd47cd Update file header and docstrings 2015-11-12 18:04:48 +01:00
Daren Lord 2812fae721 Fixing bug when connecting to squeezebox and it is a float 2015-11-11 16:21:42 -07:00
Tom Duijf 6da88108fe Merge pull request #612 from balloob/dt_snmp_fix
Fix memory issue in SNMP device tracker
2015-11-11 23:30:43 +01:00
Tom Duijf 5503c12cfd Fixes memory consumption issue 2015-11-11 21:54:33 +00:00
hexxter 329d63ac11 next online unittest test ;) 2015-11-11 20:52:41 +01:00
hexxter 698e30bd2b more self.hass.pool.block_till_done() 2015-11-11 20:40:21 +01:00
hexxter 90063ea7f8 check the default value only checkable local. I removed it. 2015-11-11 12:44:59 +01:00
hexxter 0c52b143ae now saved 2015-11-11 12:38:10 +01:00
hexxter 8f12b997f8 more unittests 2015-11-11 12:32:24 +01:00
Arthur Andersen 877926cfee [Zwave] Fix docstring 2015-11-11 10:24:00 +01:00
Arthur Andersen 19649390d3 [Zwave] Add binary switch component 2015-11-11 10:24:00 +01:00
Paulus Schoutsen 50d19bb1b4 Merge pull request #592 from leoc/feature-zwave-lights
Implement zwave light support
2015-11-11 00:11:51 -08:00
Arthur Andersen 665436cd91 [Zwave] Use threading.Timer for value refresh delay 2015-11-10 19:59:45 +01:00
Paulus Schoutsen 1a3410119e Merge pull request #606 from fabaff/pushetta
Pushetta notification platform
2015-11-10 09:27:16 -08:00
Fabian Affolter bf2bcb6dcf Use _LOGGER.error instead of _LOGGER.exception 2015-11-10 18:20:10 +01:00
Fabian Affolter 8371b08676 Add pushetta notify platform 2015-11-10 14:17:28 +01:00
Fabian Affolter e8a0d54fdd Add pushetta 2015-11-10 14:17:28 +01:00
Fabian Affolter f4a82c6f6b Add pushetta 2015-11-10 14:17:28 +01:00
Paulus Schoutsen 963c4bb70e Update frontend with new card style 2015-11-10 00:56:56 -08:00
Paulus Schoutsen ec2e0cc77d Compile new version frontend 2015-11-10 00:27:41 -08:00
Paulus Schoutsen 0c0ccb361d Merge branch 'dev-tool-info' into dev 2015-11-10 00:25:33 -08:00
Paulus Schoutsen 994fc32f25 Upgrade frontend with about page 2015-11-10 00:25:19 -08:00
Paulus Schoutsen d68263d5c4 Another LimitlessLED color fix 2015-11-09 21:55:49 -08:00
Paulus Schoutsen 27b001df2b Add dev info to frontend urls 2015-11-09 21:48:36 -08:00
Paulus Schoutsen dafc0ced6b Update limitlessled with lists for colors 2015-11-09 16:55:10 -08:00
Paulus Schoutsen 3ec2555c66 Merge pull request #601 from balloob/package-install-global
Check global installed packages
2015-11-09 12:45:51 -08:00
Fabian Affolter bfa8e58879 Update link to docs (Jekyll 3 update) 2015-11-09 18:33:11 +01:00
Paulus Schoutsen 2d9a785c18 Merge pull request #600 from balloob/cleanup-notify
Clean up notifiy component
2015-11-09 07:32:13 -08:00
Fabian Affolter 97f9f8aa49 Update link to docs (Jekyll 3 update) 2015-11-09 13:12:18 +01:00
Fabian Affolter 64d5ca4da0 Add link to docs and update some docstrings 2015-11-09 08:25:46 +01:00
Paulus Schoutsen 4fb301b7a9 Check global installed packages 2015-11-08 22:55:22 -08:00
Paulus Schoutsen fda65a4934 Update coveragerc 2015-11-08 22:33:43 -08:00
Paulus Schoutsen 98b4c27211 Style fixes 2015-11-08 22:21:02 -08:00
Paulus Schoutsen 3b3f5fe6fe Clean up notifiy component 2015-11-08 22:15:34 -08:00
Paulus Schoutsen 1c9c5ce1bd Merge pull request #599 from ryanturner/dev
Initial implementation of mjpeg camera
2015-11-08 22:13:49 -08:00
Ryan Turner a36b315927 Fixed indentations hopefully 2015-11-09 00:11:11 -06:00
Ryan Turner f3352546c6 More lint fixes 2015-11-09 00:00:31 -06:00
Ryan Turner 3a6aa8f3d1 Fixed line length issues to make lint happy. Still bummed that I decreased test coverage :( 2015-11-08 23:51:01 -06:00
Ryan Turner dfa81b0117 Changed camera.mjpeg to use Response and Closing; cleaned up a number of code-clarity issues near that 2015-11-08 23:41:21 -06:00
Paulus Schoutsen 3947691347 Style fixes + rename honeywell 2015-11-08 20:56:11 -08:00
Ryan Turner 8541fdb112 Fixed style issue related to failing build 2015-11-08 22:26:27 -06:00
Ryan Turner e078ab53ca Initial implementation of mjpeg camera 2015-11-08 22:15:06 -06:00
Paulus Schoutsen 0665af7f0f Merge branch 'pr/579' into dev
Conflicts:
	requirements_all.txt
2015-11-08 20:10:30 -08:00
Paulus Schoutsen 6dfb8f5737 Merge pull request #591 from balloob/error-log
Expose API to view error log
2015-11-08 20:06:56 -08:00
Paulus Schoutsen 1be2be0886 Merge pull request #590 from balloob/light-rgb
Light: base color now in RGB instead of XY
2015-11-08 20:06:49 -08:00
Paulus Schoutsen 3a095f53a8 Merge pull request #596 from badele/dev
Minor change for logger component
2015-11-08 19:57:58 -08:00
Paulus Schoutsen ffce252a12 Merge pull request #598 from SEJeff/update-foscam-snapshot
Make a single request to get the foscam camera image
2015-11-08 19:57:21 -08:00
Paulus Schoutsen 7f4c13c382 Upgrade Wink version to v0.1.1 2015-11-08 19:41:22 -08:00
Jeff Schroeder 0f292e8fa6 Remove unused import for re 2015-11-08 20:37:29 -06:00
badele e63d0c51e0 Change log severity 2015-11-08 19:02:51 +01:00
badele ebaecdb9d6 Fix flake & pylint 2015-11-08 11:29:56 +01:00
badele fd50693ca7 Minor change to documentation for logger component 2015-11-08 11:26:36 +01:00
badele ebc95aca51 Add log info in the rfxtrx component 2015-11-08 11:15:03 +01:00
Jeff Schroeder 137cadb59c Make a single request to get the foscam camera image
This uses the `snapPicture2` command, which is documented in their
cgi sdk to return raw jpeg data instead of html containing the image
2015-11-07 20:18:46 -06:00
Arthur Andersen 84f81480bb [Zwave] Add light zwave component 2015-11-07 15:58:28 +01:00
Arthur Andersen 5565e418f8 [Zwave] Add type and genre to value filter 2015-11-07 15:57:46 +01:00
Arthur Andersen 5b4fc4f346 [Zwave] Add check for missing discovery_service 2015-11-07 15:57:28 +01:00
Paulus Schoutsen e4c3d47dbf Expose API to view error log 2015-11-07 01:44:02 -08:00
Paulus Schoutsen 95320f39b3 Light: base color now in RGB instead of XY 2015-11-07 01:25:33 -08:00
Paulus Schoutsen 0c97280479 Merge pull request #587 from badele/logfilter
Add logger filter feature
2015-11-06 21:59:56 -08:00
Paulus Schoutsen 3e339c7304 Update vincenty version in setup.py 2015-11-06 21:58:18 -08:00
badele 6f06f48ac6 Ensure the component is loaded first 2015-11-06 22:57:03 +01:00
badele aeacbad4a0 Fix pull request from balloob comments 2015-11-06 22:51:33 +01:00
sander f60f3fa4a2 Removed unused self._sensorid. 2015-11-06 08:37:22 +01:00
MartinHjelmare 45fe37a301 Add mysensors component and switch platform
* Add a general mysensors component. This sets up the serial comm
        with the gateway through pymysensors. The component also
        contains a decorator function for the callback function of
        mysensors platforms. Mysensors platforms should create a
        function that listens for the node update event fired by the
        mysensors component. This function should call another
        function, that uses the decorator, and returns a dict. The dict
        should contain a list of which mysensors V_TYPE values the
        platform handles, the platfrom class and the add_devices
        function (from setup_platform).
    * Change existing mysensors sensor platform to depend on the new
        mysensors component.
    * Add a mysensors switch platform. The switch platform takes
        advantage of new functionality from the the fork of pymysensors
        https://github.com/MartinHjelmare/pymysensors, that enables the
        gateway to send commands to change node child values.
    * Change const and is_metric to global constants, in the mysensors
        component and import const depending on the mysensors version
        used.
    * Change variables devices and gateway to global variables.
    * Add some debug logging at INFO log level.
2015-11-06 01:58:41 +01:00
sander e49dc94d4b slightly better update method. 2015-11-05 09:58:35 +01:00
sander 26a6438e93 learning the alphabet ;-) 2015-11-05 09:37:05 +01:00
Paulus Schoutsen cae71a73a1 Update frontend 2015-11-05 00:03:01 -08:00
Paulus Schoutsen df7f6e1235 Remove alarm sensor from demo platform 2015-11-04 23:53:22 -08:00
badele a31f7d2816 Fix flake & pylint 2015-11-04 22:08:15 +01:00
badele c52c982510 Add logger feature 2015-11-04 21:30:02 +01:00
sander ea06d946e6 modified .converagerc and requirements_all.txt 2015-11-04 21:15:56 +01:00
Paulus Schoutsen bd798b8c55 Merge pull request #582 from balloob/mdi-icons
Icons for everyone!
2015-11-04 09:08:34 -08:00
Paulus Schoutsen ac7456b73b Merge pull request #577 from happyleavesaoc/limitlessled_additions
LimitlessLED effects
2015-11-04 09:02:43 -08:00
Fabian Affolter d69b08ecf5 Update with comments from PR 579 2015-11-03 11:46:03 +01:00
Paulus Schoutsen be6dd20236 Update frontend with new icons 2015-11-03 00:20:59 -08:00
Paulus Schoutsen 4d069323f4 Add icon support to entity 2015-11-03 00:20:48 -08:00
Paulus Schoutsen 77f4fc8c22 Frontend: Add materialdesignicons 2015-11-03 00:20:20 -08:00
Paulus Schoutsen 72b4212b19 Demo uses device tracker demo platform 2015-11-03 00:19:28 -08:00
Fabian Affolter 5fce381b89 Remove empty point 2015-11-03 08:50:27 +01:00
happyleaves 7b968f6a6b re-fix conditionals 2015-11-02 18:11:58 -05:00
happyleaves 4d958c6d18 style fix 2015-11-02 18:08:17 -05:00
happyleaves 566712023d consolidate conditionals 2015-11-02 18:08:17 -05:00
happyleaves 3cd89f8474 add disco, white effects 2015-11-02 18:08:17 -05:00
Fabian Affolter 218a05356a Add docstrings 2015-11-02 21:00:53 +01:00
hexxter 186f68cce3 not working mqtt light unittest 2015-11-02 20:16:36 +01:00
hexxter 168eb8e5a2 mqtt light test is working more test should be written 2015-11-02 17:02:34 +01:00
Paulus Schoutsen c6b5a04312 Allow more static files to be fingerprinted 2015-11-02 00:03:53 -08:00
Paulus Schoutsen 728cd8bb5e Upgrade Vincenty to latest version 2015-11-02 00:03:53 -08:00
Stefan Jonasson d873ab0262 Merge pull request #569 from stefan-jonasson/dev
Fix for Philio Zwave devices which don't send an off event.
2015-11-02 08:15:57 +01:00
Daniel Høyer Iversen 0ff6a460c2 Update rfxtrx.py 2015-11-01 14:20:11 +01:00
Daniel Høyer Iversen 77539a5b89 revert prev commit 2015-11-01 12:51:09 +01:00
Daniel Høyer Iversen 92b05389f2 Update rfxtrx.py 2015-11-01 12:41:21 +01:00
Daniel Høyer Iversen 82aec895a0 Minor bug in rfxtrx 2015-11-01 12:40:41 +01:00
Stefan Jonasson ec732becfc Fixed the get_config_value method when the zwave node was changed while reading it. 2015-10-31 23:34:19 +01:00
Stefan Jonasson c4261ae2e0 Z-Wave workaround - Added a default value if we did not get any config value. 2015-10-31 23:03:40 +01:00
Stefan Jonasson cae8932b18 Z-Wave workaround - Connected to the timeout to the configured node value "9. Turn Off Light Time" 2015-10-31 21:23:33 +01:00
sander efacd66bec linting and flakeing.. 2015-10-31 20:35:23 +01:00
hexxter 31826ab263 redesigned mqtt light an first steps with the unittest system 2015-10-31 19:26:03 +01:00
Paulus Schoutsen 6bb95f5c9b Merge pull request #560 from pavoni/add-vera-dimmer
Add vera dimmer
2015-10-30 21:47:02 -07:00
Paulus Schoutsen 46761d827f Merge pull request #570 from nkgilley/actiontec-fix
Actiontec device_tracker bugfix and removed home_interval
2015-10-30 21:18:28 -07:00
Paulus Schoutsen 288db9a57f Merge pull request #559 from balloob/light_ct_color
Color temperature support for light component and hue platform
2015-10-30 19:11:24 -07:00
Tom Duijf b76471c4b3 :( .. pyliny 2015-10-30 19:15:38 +00:00
Tom Duijf 194c6343ac Minor corrections to light and light/demo 2015-10-30 19:01:42 +00:00
Stefan Jonasson 2ad647bb09 Style fixes 2015-10-30 15:30:08 +01:00
Stefan Jonasson a56173676e Fixed the workaround match logic 2015-10-30 15:28:06 +01:00
Nolan Gilley e961dd5f95 increase valid for time to 60 since I was having some issues. removed deprecated lines. 2015-10-30 07:00:35 -04:00
pavoni 0269be5813 Update pyvera version 2015-10-30 09:39:30 +00:00
pavoni 031d5ce255 Fix style issues, update pyvera version. 2015-10-30 09:37:16 +00:00
sander 85bb828149 changed requirements to the latest evohome version. 2015-10-29 21:17:10 +01:00
Paulus Schoutsen c7a0b5800c Update links in introduction component 2015-10-29 00:23:05 -07:00
Tom Duijf f456d2ff23 styling fix 2015-10-28 23:16:25 +00:00
Tom Duijf 6bad702db4 Renamed to color_temp, removed capabilities (not needed afterall) 2015-10-28 23:12:16 +00:00
Nolan Gilley bcb2451752 fix pylint warning 2015-10-28 17:47:13 -04:00
Nolan Gilley 8eeca94517 removed home_interval option since it was added to the main device_tracker component 2015-10-28 17:43:41 -04:00
Nolan Gilley 3b37a7b737 bugfix for actiontec device tracker 2015-10-28 17:20:15 -04:00
Stefan Jonasson d578bf3494 Removed extra pylint hint from a previous merge 2015-10-28 22:17:17 +01:00
Stefan Jonasson 8cb046a4a9 Merge remote-tracking branch 'origin/dev' into dev 2015-10-28 22:16:00 +01:00
Stefan Jonasson 30de5af445 Fix for Philio Zwave devices which don't send an off event. 2015-10-28 22:08:50 +01:00
Stefan Jonasson f74a6ed4c9 Merge remote-tracking branch 'origin/dev' into dev
Conflicts:
	homeassistant/components/script.py
	homeassistant/helpers/entity_component.py
2015-10-28 21:43:46 +01:00
Stefan Jonasson f3500542dd Added pylint hint 2015-10-28 21:42:42 +01:00
Paulus Schoutsen 2eb65c8eb8 Version bump to 0.8.0.dev0 2015-10-28 12:45:57 -07:00
Paulus Schoutsen f8bb807707 Merge pull request #568 from balloob/dev
0.7.7
2015-10-28 12:45:42 -07:00
Paulus Schoutsen 5f40115605 Version bump to 0.7.7 2015-10-28 12:43:04 -07:00
Paulus Schoutsen 776616bcac Merge pull request #562 from pavoni/efergy_error_handling
Log request exceptions in Efergy sensor
2015-10-28 12:41:42 -07:00
Paulus Schoutsen a98cb798f7 Merge pull request #567 from balloob/fix-script-regression
Fix script regression
2015-10-28 12:37:50 -07:00
Paulus Schoutsen 12495c717e Fix script regression 2015-10-28 12:24:33 -07:00
Stefan Jonasson 10c95b4352 Added pylint hint 2015-10-28 20:17:17 +01:00
Stefan Jonasson 48bfc98acb Fixed entity name 2015-10-28 19:52:09 +01:00
Stefan Jonasson de027609d8 Fixed entity_id for the script component. Alias now does not override the entity_id
Fixed issue: #561
2015-10-28 12:27:58 +01:00
pavoni 16a3511c0a Catch request exceptions and log a warning 2015-10-28 10:57:10 +00:00
Paulus Schoutsen 0a36c96a55 Fill in service info for thermostat 2015-10-27 19:51:50 -07:00
pavoni 6ef0d089ea Add VeraLight class based on VeraSwitch - add dimmer support 2015-10-27 23:18:46 +00:00
Fabian Affolter b3b2f2e326 Fix pylint and flake issues 2015-10-28 00:18:03 +01:00
Fabian Affolter bef0b2b01e Make pins optional 2015-10-27 23:51:16 +01:00
Tom Duijf 805aecd6f9 pylint & flake cleanup 2015-10-27 22:49:45 +00:00
Tom Duijf e4d33bc6d4 Included ct_color in code coverage 2015-10-27 22:45:35 +00:00
Tom Duijf e25503bc4a Hue device capabilities. Color temperature support for light component and hue platform 2015-10-27 22:34:49 +00:00
root 4fcd27e905 light/mqtt to .coveragerc 2015-10-27 16:52:43 +01:00
Fabian Affolter 52b1080ccd Catch invalid chat ids 2015-10-27 14:26:44 +01:00
root 0128357024 Merge remote-tracking branch 'upstream/dev' into dev 2015-10-27 07:52:04 +01:00
root c5f8095f53 Merge remote-tracking branch 'upstream/master' into dev 2015-10-27 07:51:21 +01:00
Paulus Schoutsen ab48a94d2a Version bump to 0.7.7.dev0 2015-10-26 21:32:07 -07:00
Paulus Schoutsen 27c6c27db6 Merge pull request #554 from balloob/dev
0.7.6-rc1
2015-10-26 21:31:41 -07:00
Paulus Schoutsen 55c0ee6b32 Version bump to 0.7.6 2015-10-26 21:27:50 -07:00
Paulus Schoutsen 6b881ce1cd Merge pull request #547 from krzynio/dev
Add new OpenWRT presence detection routine based on ubus instead of luci
2015-10-26 21:26:13 -07:00
Paulus Schoutsen 9ab9d0e383 Update netdisco requirement 2015-10-26 20:49:20 -07:00
pavoni dbc05450a0 Bump requirements_all.txt version, remove pylint disable 2015-10-26 16:32:12 +00:00
root b66e4f1e15 two different demo lights on without RGB and one with RGB support.
and code cleanup more pylint aligned
2015-10-26 15:05:01 +01:00
Krzysztof Koziarek 649124d162 Added ubus.py to .coveragerc 2015-10-26 11:55:20 +01:00
pavoni 49f4d92c62 Add dimmer as switch 2015-10-26 10:51:23 +00:00
Krzysztof Koziarek fbb73dd5da fixed pylint warnings 2015-10-26 11:50:09 +01:00
Krzysztof Koziarek c9f1dce6a2 Coding style fixes 2015-10-26 11:32:00 +01:00
pavoni ef6c209c6f Revise for clarity, disable pylink check 2015-10-26 09:03:57 +00:00
pavoni 0826ae2742 Revise pywemo version, update discovery.device_from_description parameters 2015-10-26 08:37:13 +00:00
Paulus Schoutsen 18747f8ae1 Update some docs 2015-10-25 23:12:10 -07:00
Paulus Schoutsen 06c8c1b168 Update to latest version frontend 2015-10-25 23:12:10 -07:00
Paulus Schoutsen 160fb6fcc8 Merge pull request #553 from balloob/download_relative
Download - relative / absolute path
2015-10-25 21:06:33 -07:00
Paulus Schoutsen f1aa685cf2 Add version to config API 2015-10-25 21:00:22 -07:00
Paulus Schoutsen da259d75a2 Update frontend with imprpved charts 2015-10-25 19:01:51 -07:00
Tom Duijf 9104ca815d Indentation 2015-10-26 00:13:47 +00:00
Tom Duijf 52193611cd Check for relative path 2015-10-26 00:10:32 +00:00
Paulus Schoutsen a2256f6c97 Update version frontend 2015-10-25 15:39:50 -07:00
Paulus Schoutsen 004bad7f00 Merge pull request #551 from balloob/mp_plex_discovery
Media_player/plex discovery
2015-10-25 15:38:42 -07:00
root a8c2cc4c33 rework for flake8 errors done 2015-10-25 23:38:24 +01:00
root 538f8545f7 fix a bug after the pylint rework 2015-10-25 23:04:43 +01:00
root 7cfce94dfb pylint rework for light/mqtt 2015-10-25 22:58:07 +01:00
Paulus Schoutsen e490388843 Merge pull request #544 from MakeMeASandwich/hyperion
Hyperion ambilight remote support
2015-10-25 14:34:22 -07:00
Fabian Affolter fb8edca942 Add link to docs, fix typo, and update log output 2015-10-25 22:21:25 +01:00
root 469d0619ba mqtt light component 2015-10-25 21:48:01 +01:00
Tom Duijf bc8c5766d4 Logic fixes 2015-10-25 17:54:48 +00:00
Tom Duijf 5b25d9ccd6 flake8,pylint and other code cleanup 2015-10-25 17:00:54 +00:00
Fabian Affolter 0d05930765 Update 2015-10-25 15:58:58 +01:00
Fabian Affolter f93282d636 Add link to docs 2015-10-25 15:58:58 +01:00
Fabian Affolter 78ad2686d4 Add link to docs 2015-10-25 15:58:58 +01:00
Fabian Affolter 3c36d13e8d Add link to docs 2015-10-25 15:58:58 +01:00
Fabian Affolter 77ba0c0393 Add link to docs 2015-10-25 15:58:58 +01:00
Fabian Affolter 6a3316ed12 Add link to docs 2015-10-25 15:58:58 +01:00
Fabian Affolter 415d650860 Add link to docs 2015-10-25 15:58:58 +01:00
Fabian Affolter c3c248bc0a Add link to docs 2015-10-25 15:58:58 +01:00
Fabian Affolter bf027fcd48 Add link to docs 2015-10-25 15:58:58 +01:00
Fabian Affolter 5c79fc0ae3 Add link to docs 2015-10-25 15:58:58 +01:00
Fabian Affolter 0aaf280bf5 Add link to docs 2015-10-25 15:58:58 +01:00
Fabian Affolter 55de563511 Add link to docs 2015-10-25 15:58:58 +01:00
Fabian Affolter 1a018e3ee7 Remove configuration details 2015-10-25 15:58:58 +01:00
Fabian Affolter b023348795 Add link to docs 2015-10-25 15:58:58 +01:00
Tom Duijf 847d9736aa Configurator works, config saving basic implementation 2015-10-25 13:34:34 +00:00
Tom Duijf 884525df33 Basic discovery works, added plex logo for configurator. Missing configurator support for fields. Todo: config save on successful connect 2015-10-25 13:34:34 +00:00
Tom Duijf 6a82504e5e further discovery integration into plex 2015-10-25 13:34:34 +00:00
Tom Duijf db7e46abd1 Intermediate save 2015-10-25 13:33:47 +00:00
Tom Duijf 8e9cafd29d Updated requirements_all.txt. Added placeholder to the empty deviceClass filter. Will remove this if deemed unneeded, later 2015-10-25 13:32:15 +00:00
Tom Duijf a236b87ccf new attempt for PR 2015-10-25 13:32:15 +00:00
MakeMeASandwich e379e3d902 Merge branch 'dev' of https://github.com/balloob/home-assistant into hyperion 2015-10-25 11:29:02 +01:00
MakeMeASandwich 1be48f54c0 light/hyperion: close sockets, report setup success 2015-10-25 11:08:59 +01:00
Paulus Schoutsen 96181a555a Allow pipes in command sensors and services 2015-10-24 12:40:36 -07:00
Paulus Schoutsen e461ceae36 discovery: update Netdisco requirement 2015-10-24 12:18:48 -07:00
Paulus Schoutsen 83e6c24f18 Re-enable Z-Wave for Docker 2015-10-24 11:36:34 -07:00
Krzysztof Koziarek 50fbd83b3d corrected flake8 warnings 2015-10-24 11:20:57 +02:00
Fabian Affolter 649275044a Remove configuration details 2015-10-24 09:13:54 +02:00
Fabian Affolter 0f81fc60ad Remove configuration details 2015-10-24 09:10:31 +02:00
Paulus Schoutsen ade8681511 Exclude rest switch from coverage 2015-10-23 23:44:17 -07:00
Paulus Schoutsen 7a699fd819 Merge pull request #539 from nkgilley/forecastio-units
Forecastio: Added support for specifying unit system in the configuration file.
2015-10-23 22:54:31 -07:00
Paulus Schoutsen b0c0659acc Merge branch 'clean-up-heat-control' into dev
Conflicts:
	homeassistant/components/thermostat/heat_control.py
2015-10-23 22:51:00 -07:00
Paulus Schoutsen 80a9422a9a Merge pull request #545 from MakeMeASandwich/denon
Refactor denon remote
2015-10-23 22:40:37 -07:00
Fabian Affolter 060cbaf66b Add return value 2015-10-24 00:38:19 +02:00
Fabian Affolter c19120e012 Check import 2015-10-24 00:34:49 +02:00
Fabian Affolter 1e0e48fcd7 Use logger the same as other platforms do 2015-10-24 00:29:47 +02:00
Fabian Affolter f2fda2914a Fix continuation 2015-10-24 00:29:02 +02:00
Fabian Affolter 7e3483ab03 Remove configuration details 2015-10-24 00:24:14 +02:00
Fabian Affolter bffce11a9a Remove configuration details 2015-10-24 00:20:18 +02:00
Fabian Affolter 8a895390ef Merge pull request #534 from bachp/dev
Add simple REST switch
2015-10-23 23:52:40 +02:00
Fabian Affolter 97f81ad7a6 Add more details 2015-10-23 23:48:57 +02: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
Fabian Affolter 3406b41b0c Fix return value 2015-10-23 23:08:27 +02:00
Fabian Affolter 2e7912157b Remove configuration details 2015-10-23 23:00:20 +02:00
Fabian Affolter 5dbdf82ec7 Fix typo 2015-10-23 22:58:00 +02:00
Fabian Affolter 9f4a3f4aea Use the logger the same way as other platforms do 2015-10-23 22:57:07 +02:00
Fabian Affolter 4f3b3a9e34 Use the logger the same way as other platforms 2015-10-23 22:53:58 +02:00
Fabian Affolter 3ea167203f Remove configuration details 2015-10-23 22:48:30 +02:00
Fabian Affolter 756cbe1b08 Remove configuration details 2015-10-23 22:41:13 +02:00
Fabian Affolter 87e55820e7 Add link docs 2015-10-23 22:39:04 +02:00
Fabian Affolter f828ee044d UPdate docstring 2015-10-23 22:34:23 +02:00
Fabian Affolter a8e2f9cbb7 Remove configuration details 2015-10-23 22:34:02 +02:00
Fabian Affolter 2e3f462474 Update docstring 2015-10-23 22:32:36 +02:00
Fabian Affolter 3f6780d9be Remove configuration details 2015-10-23 22:31:37 +02:00
Fabian Affolter e21921823e Update docstring 2015-10-23 22:29:22 +02:00
Fabian Affolter f9b2e0058e Fix typo 2015-10-23 19:01:38 +02:00
Fabian Affolter a155587693 Remove configuration details 2015-10-23 19:01:19 +02:00
Fabian Affolter 0e145ec130 Remove configuration details 2015-10-23 18:39:50 +02:00
Fabian Affolter 44b08a06e7 Remove configuration details 2015-10-23 18:26:36 +02:00
Fabian Affolter 75f737144a Remove configuration details 2015-10-23 18:24:07 +02:00
Fabian Affolter 170742b0a7 Remove configuration details 2015-10-23 18:15:12 +02:00
Fabian Affolter 6115be7c42 Remove configuration details 2015-10-23 18:13:45 +02:00
Fabian Affolter 84a9a300d6 Fix link 2015-10-23 18:13:28 +02:00
Fabian Affolter 55718aac66 Remove configuration details 2015-10-23 18:10:32 +02:00
MakeMeASandwich b6e6512367 media_player/denon: refactor
* connect only if necessary
* do not throw errors if offline
2015-10-23 17:35:08 +02:00
Krzysztof Koziarek 29c9c5a7ec Add new OpenWRT presence detection routine based on ubus instead of luci 2015-10-23 17:01:42 +02:00
Nolan Gilley dd787ea5ce remove suggestion for uk unit system. change default to use si or us based on default temperature. added more sensor types. 2015-10-23 10:10:44 -04:00
Paulus Schoutsen c2d75efb4d Add missing docstring to heat control thermo 2015-10-22 22:14:40 -07:00
Paulus Schoutsen 3d972abdab Clean up the heat control thermostat 2015-10-22 22:04:37 -07:00
Fabian Affolter 7801489149 Remove configuration details 2015-10-21 23:05:54 +02:00
Fabian Affolter 0fda89e983 Remove configuration details 2015-10-21 23:05:38 +02:00
Fabian Affolter 07a75c5eeb Remove configuration details 2015-10-21 23:05:13 +02:00
Fabian Affolter 0b7c407519 Remove configuration details 2015-10-21 22:54:42 +02:00
Fabian Affolter 3c34f3dac2 Remove configuration details 2015-10-21 22:53:26 +02:00
Fabian Affolter d45074f9dc Remove configuration details 2015-10-21 22:53:09 +02:00
sander 863955e1bd got the basics working 2015-10-21 21:48:21 +02:00
Fabian Affolter 4ff1b0fdb2 Add link to docs 2015-10-21 21:26:16 +02:00
Fabian Affolter ba13f13442 Remove configuration details 2015-10-21 21:12:25 +02:00
Fabian Affolter e615755eb9 Remove configuration details 2015-10-21 21:11:51 +02:00
Fabian Affolter 352d3532e7 Remove configuration details 2015-10-21 21:11:18 +02:00
Fabian Affolter 7b60f6ca77 Remove configuration details 2015-10-21 19:43:24 +02:00
Fabian Affolter a2e8fcbc77 Remove newline 2015-10-21 19:37:34 +02:00
Fabian Affolter e10fd0d28b Remove configuration details 2015-10-21 19:36:52 +02:00
sander f376061e23 Revert "had to change to let this work on windows."
This reverts commit 6c106a87f1.
2015-10-21 19:00:23 +02:00
sander 076b3db5e8 first try 2015-10-21 19:00:15 +02:00
Fabian Affolter 89964ad793 Remove configuration details 2015-10-21 16:46:31 +02:00
Fabian Affolter bddd02bd58 Remove configuration details 2015-10-21 16:45:45 +02:00
Fabian Affolter cfb3384ee3 Add link to docs 2015-10-21 16:38:33 +02:00
Fabian Affolter 490e9ee95d Add link to docs 2015-10-21 16:37:41 +02:00
Fabian Affolter 0d0eb7e7c0 Add link to docs 2015-10-21 16:10:47 +02:00
Fabian Affolter 3d4af8c229 Remove configuration details 2015-10-21 10:56:32 +02:00
Fabian Affolter 7e23c241da Update docstring 2015-10-21 10:49:25 +02:00
Fabian Affolter 7ec1424825 Add link to docs 2015-10-21 10:47:31 +02:00
Fabian Affolter 9162149598 Add link to docs 2015-10-21 10:47:12 +02:00
Fabian Affolter da31b54d06 Add link to docs 2015-10-21 10:45:08 +02:00
Fabian Affolter b20a757454 Remove configuration details 2015-10-21 10:44:29 +02:00
Fabian Affolter 761f225c86 Update link 2015-10-20 22:20:58 +02:00
Fabian Affolter 5580309d98 Remove configuration details 2015-10-20 22:20:58 +02:00
Fabian Affolter 52b4c3b5a2 Remove configuration details 2015-10-20 22:20:58 +02:00
Fabian Affolter aed61cecff Remove configuration details 2015-10-20 22:20:58 +02:00
Fabian Affolter ef129639bd Remove configuration details 2015-10-20 22:20:58 +02:00
Fabian Affolter f945a3a692 Move configuration details to docs 2015-10-20 22:20:58 +02:00
Fabian Affolter 5e56eae28f Move configuration details to docs 2015-10-20 22:20:58 +02:00
Fabian Affolter 72ad1387f0 Move configuration details to docs 2015-10-20 22:20:58 +02:00
Fabian Affolter 02cfc70ad5 Add link to component 2015-10-20 22:20:58 +02:00
Fabian Affolter 5a21b677a1 Add link to component 2015-10-20 22:20:58 +02:00
Fabian Affolter c1a73d250a Add link to component 2015-10-20 22:20:58 +02:00
Fabian Affolter 8c544a89c9 Remove configuration details 2015-10-20 22:20:58 +02:00
Fabian Affolter c473d426e3 Remove configuration details 2015-10-20 22:20:58 +02:00
Fabian Affolter f5a62f8381 Remove configuration details 2015-10-20 22:20:58 +02:00
Fabian Affolter 0e8e4a73fe Remove configuration details 2015-10-20 22:20:58 +02:00
Fabian Affolter 74700e4b10 Add link to doc and remove configuration details 2015-10-20 22:20:58 +02:00
Fabian Affolter 4d5c9581bf Add link to docs 2015-10-20 22:20:58 +02:00
Fabian Affolter f45e0eabe3 Add link to docs 2015-10-20 22:20:58 +02:00
Fabian Affolter bbed4a262c Fix typo 2015-10-20 22:20:44 +02:00
Fabian Affolter f8590f7d1d Include resource in error message 2015-10-20 22:20:44 +02:00
Nolan Gilley 293ed275ab Added support for specifying units in the configuration file. If no units are specified in the config file it will use location to determine the units. 2015-10-20 14:29:22 -04:00
MakeMeASandwich 2e9ee28637 light/hyperion: use RGB, clean code 2015-10-20 17:30:23 +02:00
Paulus Schoutsen 73cb23f599 Merge pull request #535 from toddeye/radiotherm-dev
radiotherm platform bug fix and configuration parameter
2015-10-19 23:28:10 -07:00
Todd Ingarfield 661f4c594e formatting 2015-10-19 16:54:42 -05:00
Todd Ingarfield 9464e2a13b Add hass configuration parameter hold_temp & config documentation 2015-10-19 16:18:45 -05:00
Todd Ingarfield 27d5248937 Fix configuration for multiple hosts and add example configuration.yaml section 2015-10-19 15:33:23 -05:00
MakeMeASandwich c5a7e3abd1 Merge branch 'dev' of https://github.com/balloob/home-assistant into dev 2015-10-19 20:09:38 +02:00
Paulus Schoutsen 0a6424a81d Merge pull request #529 from persandstrom/lms_pause
bugfix, LMS pause
2015-10-18 13:01:43 -07:00
Per Sandström 5b7389de55 bugfix, 1 = force pause 2015-10-18 21:05:30 +02:00
Paulus Schoutsen 0fe4e0330a Merge pull request #528 from fabaff/arest-sensor
Add pins feature to arest sensor
2015-10-18 10:32:57 -07:00
Fabian Affolter 40b095b866 Add option to use pins 2015-10-18 18:05:25 +02:00
MakeMeASandwich 7141a99927 fix flake warning 2015-10-18 09:10:41 +02:00
Fabian Affolter f01d2b1263 Allow to overwrite the device name 2015-10-18 00:42:02 +02:00
Fabian Affolter 3c6420c538 Allow to overwrite the device name 2015-10-18 00:41:12 +02:00
MakeMeASandwich e3304caf06 add hyperion light support 2015-10-17 19:36:52 +02:00
Fabian Affolter 91a1fb0240 Remove wrong file 2015-10-16 09:12:37 +02:00
Paulus Schoutsen 6fd32e83c8 Update .coveragerc 2015-10-15 13:50:06 -07:00
Paulus Schoutsen b41caa093c Merge pull request #503 from toddeye/radiotherm-platform
Add Radio Thermostat platform
2015-10-15 13:45:52 -07:00
Paulus Schoutsen 806c71c803 Merge pull request #522 from balloob/script-cleanup
Script clean up
2015-10-15 13:44:46 -07:00
Todd Ingarfield b0bafa32b7 fixed typo in requirements_all.txt 2015-10-15 11:44:19 -05:00
Fabian Affolter 332ac794a4 Modify the import style 2015-10-15 18:22:42 +02:00
Paulus Schoutsen 5dfd0d2502 Fix another manual alarm regression 2015-10-15 08:39:38 -07:00
Todd Ingarfield 3d838c307f merged upstream and fixed conflict 2015-10-15 10:13:02 -05:00
Paulus Schoutsen 2dd77f9477 Merge pull request #523 from fabaff/cpuinfo
CPU Speed sensor
2015-10-15 07:33:18 -07:00
sander 6c106a87f1 had to change to let this work on windows. 2015-10-15 15:02:09 +02:00
Fabian Affolter 1279bf7c68 Add py-cpuinfo 2015-10-15 12:13:35 +02:00
Fabian Affolter 323d301072 Add cpuspeed sensor 2015-10-15 12:13:16 +02:00
Fabian Affolter b1815075ac Add cpuspeed sensor 2015-10-15 12:13:04 +02:00
Paulus Schoutsen 7ba4263284 Fix regression manual alarm 2015-10-14 23:38:42 -07:00
Paulus Schoutsen 347597ebdc Base Script on entity 2015-10-14 23:15:48 -07:00
Todd Ingarfield ddeb84cb9c Removed name and netdisco functions, implemented update method to caches values, radiotherm lib to coveragerc and requirements_all.txt 2015-10-14 11:11:33 -05:00
Todd Ingarfield b2e39884f9 Removed name and netdisco functions, implemented update method to caches values, radiotherm lib to coveragerc and requirements_all.txt 2015-10-14 11:02:07 -05:00
Fabian Affolter 8d99c4a0cc Move configuration details to docs 2015-10-14 10:39:51 +02:00
Fabian Affolter 80e4f2f51f Add link to doc 2015-10-14 10:39:51 +02:00
Fabian Affolter 6064fffc8e Move configuration details to docs 2015-10-14 10:39:51 +02:00
Fabian Affolter 7da354c4c5 Move configuration details to docs 2015-10-14 10:39:51 +02:00
Paulus Schoutsen 49de153ecf Add alarm component to demo component 2015-10-13 23:21:47 -07:00
Paulus Schoutsen 716376081d Add tests for MQTT alarm 2015-10-13 23:08:12 -07:00
Paulus Schoutsen d37b70556d manual alarm: Test disarm with invalid code 2015-10-13 22:41:35 -07:00
Paulus Schoutsen 32bb950b5f Add tests for manual alarm control panel platform 2015-10-13 22:36:21 -07:00
Fabian Affolter 0e89418cbe Move configuration desciption to docs 2015-10-13 23:44:27 +02:00
Fabian Affolter fe032be352 Upgrade psutil to 3.2.2 2015-10-13 23:42:27 +02:00
Fabian Affolter 64a78d7b4f Upgrade psutil to 3.2.2 2015-10-13 23:41:46 +02:00
Fabian Affolter 24e4b9e012 Move configuration description to docs 2015-10-13 23:08:56 +02:00
Fabian Affolter a44a39003d Move configuration description to docs 2015-10-13 23:07:26 +02:00
Fabian Affolter f019b4f697 Move configuration details to docs 2015-10-13 22:56:12 +02:00
Fabian Affolter e353dae3a6 Move vonfiguration details to docs 2015-10-13 22:45:36 +02:00
Fabian Affolter fb84c0ce6b Move configuration details to docs 2015-10-13 22:41:53 +02:00
Fabian Affolter fd382871a1 Move configuration details to docs 2015-10-13 22:30:21 +02:00
Fabian Affolter 405025a00b Remove configuration details 2015-10-13 22:26:32 +02:00
Fabian Affolter 912ddbb4fc Add link to docs 2015-10-13 22:26:27 +02:00
Fabian Affolter 91138b8679 Move configuration details to docs 2015-10-13 22:16:26 +02:00
Fabian Affolter 893b9fc8ac Move configuration details to docs 2015-10-13 22:08:11 +02:00
Fabian Affolter 185ba000dd Add link to docs 2015-10-13 21:09:11 +02:00
Fabian Affolter 771118caaf Add link to docs 2015-10-13 21:08:51 +02:00
Fabian Affolter 17d9df0da5 Add link to docs 2015-10-13 21:08:34 +02:00
Fabian Affolter e067398134 Add link to docs 2015-10-13 21:08:18 +02:00
Fabian Affolter cb69ac30ec Add link to docs 2015-10-13 21:07:53 +02:00
Fabian Affolter 241ff45c5e Add link to docs 2015-10-13 21:07:40 +02:00
Fabian Affolter c5c2f0c5f3 Add link to docs 2015-10-13 21:07:24 +02:00
Fabian Affolter 0874cb364f Move configuration details to docs 2015-10-13 21:00:44 +02:00
Fabian Affolter 44418b509c Move configuration details to docs 2015-10-13 21:00:28 +02:00
Fabian Affolter 403889bbeb Move configuration details to docs 2015-10-13 20:55:45 +02:00
Fabian Affolter 6ca50d8b5c Move configuration details to docs 2015-10-13 20:55:15 +02:00
Fabian Affolter 0369a9ee0d Move configuration details to docs 2015-10-13 20:54:48 +02:00
Fabian Affolter 5a6ff9a69a Move configuration details to docs 2015-10-13 20:54:15 +02:00
Fabian Affolter 796cce78bc Move configuration details to docs 2015-10-13 20:52:30 +02:00
Fabian Affolter 77430c0687 Move configuration details to docs 2015-10-13 20:52:08 +02:00
Fabian Affolter c33942d6e2 Move configuration details to docs 2015-10-13 20:51:30 +02:00
Fabian Affolter 3b91f89173 Move configuration details to docs 2015-10-13 20:50:53 +02:00
Fabian Affolter c74f46794e Move configuration details to docs 2015-10-13 20:50:15 +02:00
Fabian Affolter 966fd8f24d Move configuration details to docs 2015-10-13 20:49:28 +02:00
Fabian Affolter 8253fdfc13 Add newline 2015-10-13 20:49:14 +02:00
Fabian Affolter cb7b5f8d15 Move configuration details to docs 2015-10-13 20:45:29 +02:00
Fabian Affolter b0d8eaeda9 Move configuration details to docs 2015-10-13 20:44:18 +02:00
Fabian Affolter 62cfb8aeb2 Move configuration details to docs 2015-10-13 20:42:05 +02:00
Fabian Affolter 47448d1dc0 Add link to docs 2015-10-13 20:40:59 +02:00
Fabian Affolter a583525110 Move configuration details to docs 2015-10-13 20:01:23 +02:00
Paulus Schoutsen 38e1cef30e Update frontend for style fix 2015-10-13 08:58:15 -07:00
Paulus Schoutsen e2f187879c Merge pull request #511 from wind-rider/geofancy
Geofancy
2015-10-13 00:05:17 -07:00
Paulus Schoutsen 925cde200f Merge pull request #514 from balloob/scene-turn-off-remove
Remove turning off scenes
2015-10-12 23:43:29 -07:00
Paulus Schoutsen 383efee470 Scene turn off for frontend 2015-10-12 23:40:09 -07:00
Paulus Schoutsen d5eb90160f Merge pull request #461 from sfam/manual-alarm
Add manual alarm
2015-10-12 23:13:37 -07:00
Paulus Schoutsen 2f946cc6de Merge pull request #516 from mKeRix/dev
Fix for newest tplink firmware, fixes #415
2015-10-12 23:10:30 -07:00
sfam 1b7ce2146c replace sleeps with track_point_in_time 2015-10-13 00:56:24 +00:00
Heiko Rothe 021a374a6a Merge branch 'dev' of https://github.com/mKeRix/home-assistant into dev 2015-10-12 22:44:20 +02:00
Heiko Rothe bbec34d0e6 Merge remote-tracking branch 'refs/remotes/balloob/dev' into dev 2015-10-12 22:43:55 +02:00
Heiko Rothe a6cb19b27d Fixed an issue with the initiation of the new attributes 2015-10-12 22:42:45 +02:00
Hans Bakker b74e70d4e0 Fixes based on balloob's comments 2015-10-12 20:58:24 +02:00
Paulus Schoutsen 5cd283e999 Merge pull request #513 from balloob/component-command
Add shell_command component
2015-10-12 08:43:32 -07:00
Heiko Rothe 2f2bd7a616 Fixed pylint and pep8 violations 2015-10-12 09:18:55 +02:00
Paulus Schoutsen cddc87b0ab Remove turn off from scene 2015-10-11 23:51:59 -07:00
Paulus Schoutsen d6bbc67112 Add tests for scene 2015-10-11 23:48:17 -07:00
Paulus Schoutsen 6d77b15e44 Few more tests 2015-10-11 21:41:44 -07:00
Paulus Schoutsen 916c453d2b Add test for shell command 2015-10-11 21:30:17 -07:00
Paulus Schoutsen 7786b52d93 Add shell_command component 2015-10-11 20:11:30 -07:00
Paulus Schoutsen 90d4a2c0b8 Update frontend version 2015-10-11 20:10:32 -07:00
Paulus Schoutsen b6d26597c0 Automation - state platfor: Flag if user makes config error 2015-10-11 18:30:25 -07:00
Paulus Schoutsen bf1970b78c Make thermostat more robust 2015-10-11 18:16:55 -07:00
Hans Bakker 1eb3610a11 Style fixes 2015-10-12 00:28:39 +02:00
Paulus Schoutsen f081f7c4ff Merge pull request #494 from andythigpen/mysensors-update
Update to latest mysensors library.
2015-10-11 15:14:23 -07:00
Hans Bakker 6a969208e9 Initial commit for Geofancy device tracker. 2015-10-12 00:14:05 +02:00
Andrew Thigpen 384b3d0d17 Update to latest mysensors library.
* Adds JSON persistence support.
* Adds documentation comments for configuration options.
2015-10-11 17:05:08 -05:00
Paulus Schoutsen ad5b650661 Merge pull request #504 from happyleavesaoc/dev
Amazon Fire TV device support
2015-10-11 14:54:55 -07: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
Todd Ingarfield 6c1c243000 start away mode 2015-10-11 11:42:24 -05:00
Paulus Schoutsen c2117b3eaf Merge pull request #507 from gsabbe/dev
asuswrt gives a traceback when ipv6 is enabled on the router
2015-10-11 09:26:11 -07:00
Todd Ingarfield 84c72ebf63 Add support for multiple thermostats (via hass-config) and auto-discovery via ratiotherm module 2015-10-11 09:28:25 -05:00
Guillaume SABBE a1e5bea3ab When IPv6 is enabled, dnsmasq has a configuration line with the DUID.
This looks like this
61072 b8:27:eb:e1:4e:4d 192.168.0.4 domotycoon *
61072 b8:27:eb:b8:10:6b 192.168.0.5 pimonitor *
duid 00:03:00:01:ac:22:0b:e9:98:50
When using match.group() without testing if match != None, you get a traceback.
2015-10-11 15:21:53 +02:00
Hans Bakker bee5c0adfb Merge branch 'dev' of https://github.com/balloob/home-assistant 2015-10-10 23:40:59 +02:00
happyleavesaoc 7ca21f577d fixed merge conflict 2015-10-10 16:53:55 -04:00
happyleavesaoc 168516f5da addressed PR comments 2015-10-10 16:45:13 -04:00
Paulus Schoutsen 94df5acbf3 Version bump to 0.7.6.dev0 2015-10-10 11:45:25 -07:00
Paulus Schoutsen 853a9fd4cd Merge pull request #506 from balloob/dev
0.7.5rc1
2015-10-10 11:45:06 -07:00
Paulus Schoutsen 6a18205d2e Update to version 0.7.5 2015-10-10 11:39:29 -07:00
Paulus Schoutsen 3a3b8bbb45 Fix packaging issues 2015-10-10 10:33:09 -07:00
Todd Ingarfield 37278aab20 add set_time and begin discovery 2015-10-10 11:36:34 -05:00
Fabian Affolter d3c4722529 Add some other components 2015-10-09 23:45:36 +02:00
Fabian Affolter c3de67041a Add plex 2015-10-09 23:40:06 +02:00
Fabian Affolter f07d07432d Add telegram 2015-10-09 23:38:28 +02:00
Fabian Affolter 47f994b867 Move configuration details to docs 2015-10-09 23:33:59 +02:00
Fabian Affolter a8a172c8b7 Add link to docs and remove configuration details from file header 2015-10-09 23:24:26 +02:00
happyleavesaoc d4d91bfdbb Amazon Fire TV device support 2015-10-09 17:06:35 -04:00
Fabian Affolter 7432bbd70c Merge pull request #500 from balloob/arest-fix
Throttle per instance (fixes arest)
2015-10-09 22:46:55 +02:00
Todd Ingarfield a3d295d885 Correct formatting 2015-10-09 11:38:39 -05:00
Todd Ingarfield 0cf909cce9 Correct ci failed tests 2015-10-09 11:34:14 -05:00
Todd Ingarfield fc1cf49fd3 added REQUIREMENTS for radiotherm python module 2015-10-09 10:49:54 -05:00
Todd Ingarfield e5d68d8a1e set name of device through hass config 2015-10-09 10:43:14 -05:00
Fabian Affolter 8fc2f5fe36 Update and equalize comments 2015-10-09 17:41:07 +02:00
Paulus Schoutsen c2c18bdbd5 Merge pull request #501 from fabaff/telegram
Telegram notifications
2015-10-09 07:40:40 -07:00
Fabian Affolter f8efe3f00f Update link to docs 2015-10-09 14:48:58 +02:00
Fabian Affolter db53e46705 Add link to docs and remove configuration details 2015-10-09 14:44:59 +02:00
Fabian Affolter 526a163563 Update link 2015-10-09 14:41:35 +02:00
Fabian Affolter e29f857f43 Update header (docstring) 2015-10-09 14:40:48 +02:00
Fabian Affolter 9f6ce868e2 Add telegram 2015-10-09 14:13:05 +02:00
Fabian Affolter 3ef5e7c161 Add telegram 2015-10-09 14:12:49 +02:00
Fabian Affolter fe5bb89a68 Add telegram notifier 2015-10-09 14:04:29 +02:00
Paulus Schoutsen be8089bcde Cleanup arest 2015-10-08 23:50:04 -07:00
Paulus Schoutsen 47fc1deecb Fix throttle to work on instance-level 2015-10-08 23:49:55 -07:00
Paulus Schoutsen 8a04e1f5f4 Device tracker configuration fix
Fixes #498
2015-10-08 22:19:15 -07:00
Paulus Schoutsen 9f33b8f541 DDWRT - match multiple output variants
Fixes #481
2015-10-08 22:15:12 -07:00
Paulus Schoutsen 0624725e21 Ignore nmap style issue - pylint bug 2015-10-08 21:45:51 -07:00
Paulus Schoutsen dc5f0ef314 NMap: fix hostname resolver
Fixes #482
2015-10-08 21:01:38 -07:00
Paulus Schoutsen cb2943c247 Merge pull request #499 from balloob/handle-states-for-media-player
Prioritize play_media over state change
2015-10-08 18:07:27 -07:00
Jon Maddox 45f0911640 move play_media to the top so it catches first 2015-10-08 20:37:59 -04:00
Todd Ingarfield 4ac9e9fc4c initial commit 2015-10-08 17:48:03 -05:00
Fabian Affolter 28b107ffa9 Move details from header to docs 2015-10-09 00:27:29 +02:00
Paulus Schoutsen e0149c4ee4 Merge pull request #488 from balloob/itunes-play-media
iTunes play_media
2015-10-08 12:48:35 -07:00
Paulus Schoutsen 455a5916fd Merge pull request #496 from tomduijf/local_www
Allowing custom/local files (images, etc) to be used in the webinterface
2015-10-08 12:46:23 -07:00
Tom Duijf cbf94aae55 Merge remote-tracking branch 'upstream/dev' into local_www 2015-10-08 19:32:28 +00:00
Paulus Schoutsen 39ced09727 Merge pull request #493 from tomduijf/dev_tracker_snmp
device_tracker snmp
2015-10-08 12:29:15 -07:00
Tom Duijf ad417bfdfb Merge remote-tracking branch 'upstream/dev' into local_www 2015-10-08 15:06:01 +00:00
Tom Duijf f682fd7c1f Merge remote-tracking branch 'upstream/dev' into dev_tracker_snmp 2015-10-08 15:04:15 +00:00
Tom Duijf ee23c0fe14 cleaner logging 2015-10-08 14:54:20 +00:00
Tom Duijf 5322789c14 Ability to store icons/pictures in config_dir/www for e.g. device_tracker pictures 2015-10-08 14:10:33 +00:00
Paulus Schoutsen 05cec772d0 Merge pull request #495 from kennedyshead/dev
Fix for KeyError in kodi.py
2015-10-08 06:59:26 -07:00
magnusknutas 75c3e42064 Removes log for cleanup 2015-10-08 14:00:23 +02:00
magnusknutas 61c955779b Logging with info 2015-10-08 13:55:01 +02:00
magnusknutas a015df7b01 Test for media_content_id KeyError 2015-10-08 13:41:58 +02:00
Tom Duijf 721c1d0f54 styling fix for flake 2015-10-08 10:24:55 +00:00
Tom Duijf fe37a6aecc Merge remote-tracking branch 'upstream/dev' into dev_tracker_snmp 2015-10-08 10:01:24 +00:00
Tom Duijf 85bf6cb568 Added pylint disables 2015-10-08 10:01:10 +00:00
Fabian Affolter 9f10ab5e7a Update logger output 2015-10-08 11:10:05 +02:00
Fabian Affolter 3b7f6d3b67 Update docstrings 2015-10-08 11:09:00 +02:00
Fabian Affolter d8aefb5d55 Update docstrings 2015-10-08 11:08:47 +02:00
Fabian Affolter 06cac7f9ef Update docstrings 2015-10-08 11:08:32 +02:00
Fabian Affolter 6d3f18d094 Update docstrings 2015-10-08 11:08:17 +02:00
Tom Duijf 050f90d07a merge with upstream 2015-10-08 08:24:38 +00:00
Fabian Affolter bf9b179441 Update docstrings 2015-10-08 10:23:19 +02:00
Tom Duijf 4f0f7eff5e Merge remote-tracking branch 'upstream/dev' into dev 2015-10-08 08:22:14 +00:00
Tom Duijf 4edbdab4c0 Merge remote-tracking branch 'upstream/master' into dev 2015-10-08 08:09:56 +00:00
Tom Duijf 729f59625e Merge branch 'dev' into dev_tracker_snmp 2015-10-08 08:05:03 +00:00
Tom Duijf 213a1fe4ba Various fixes, CI validation 2015-10-08 08:00:30 +00:00
Paulus Schoutsen c1899609a4 Merge branch 'pr/483' into dev
Conflicts:
	.coveragerc
2015-10-08 00:28:52 -07:00
Paulus Schoutsen 1b4ef3856a Merge pull request #471 from alanbowman/blinkstick_support
[WIP] Add blinkstick support
2015-10-08 00:05:42 -07:00
Paulus Schoutsen 4673a82c90 Merge pull request #490 from CCOSTAN/patch-3
Added # comment for Sensor
2015-10-07 23:52:45 -07:00
Tom Duijf ae6f651c7d styling and version for requirement 2015-10-07 23:22:29 +00:00
Tom Duijf 7cb0f805ee fixed loop 2015-10-07 22:17:49 +00:00
Tom Duijf d556e5979a Updated misc files and code styling 2015-10-07 21:45:24 +00:00
Fabian Affolter d149f9d64c Update doc string (Fix #491) 2015-10-07 23:28:56 +02:00
Tom Duijf 9377b647f5 removed debug logging 2015-10-07 21:05:27 +00:00
Tom Duijf 469f35d25f various fixes, initial working version 2015-10-07 21:04:34 +00:00
Carlo Costanzo 17865c78c4 Added # comment for Sensor
Comments for unique sensor labels.
2015-10-07 17:02:07 -04:00
badele a5dae78155 Refactoring the rfxtrx components 2015-10-07 19:57:40 +02:00
badele 46f5ef54a1 Refactoring test instance type 2015-10-07 19:15:50 +02:00
badele 496e4cf784 Exclude rfxtrx component files 2015-10-07 19:07:19 +02:00
badele 11fc521e60 Replace REQUIREMENTS by DEPENDENCIES variable 2015-10-07 19:04:03 +02:00
Tom Duijf a58382e763 Fixed b/octet to mac adress conversion 2015-10-07 16:57:01 +00:00
Alan Bowman 9d4aa7e519 Update tests for RGB color support 2015-10-07 13:58:21 +01:00
Jon Maddox ffbaf0cd5a simpler 2015-10-07 02:13:13 -04:00
Jon Maddox 3b58e8628d style 2015-10-07 02:02:25 -04:00
Jon Maddox c2fe977778 style 2015-10-07 01:55:15 -04:00
Jon Maddox 85338887b4 wrap it 2015-10-07 01:42:50 -04:00
Jon Maddox 9a3c76c263 these are required 2015-10-07 01:41:57 -04:00
Jon Maddox 6ab4b80486 Merge branch 'dev' into itunes-play-media 2015-10-07 01:41:21 -04:00
Paulus Schoutsen 5e0a4c316f Merge pull request #487 from balloob/media-player-play-media
Media Player play_media function
2015-10-06 22:40:36 -07:00
Jon Maddox 26939ce554 style 2015-10-07 01:37:40 -04:00
Jon Maddox c83324d4cf nope 2015-10-07 01:34:37 -04:00
Jon Maddox dbcc3a76ea style 2015-10-07 01:29:55 -04:00
Jon Maddox faa3e98921 module level play_media 2015-10-07 01:28:58 -04:00
Jon Maddox 1c4ac6017d fix typo while were in here 2015-10-07 01:21:41 -04:00
Jon Maddox 25a690691b import it from the right place 2015-10-07 01:11:19 -04:00
Jon Maddox bb997deb85 COMMMMAAAAAAAAAAAA 2015-10-07 01:06:27 -04:00
Jon Maddox 6c4b2fd638 derp 2015-10-07 01:01:25 -04:00
Jon Maddox c4f8017a3f silence warning 2015-10-07 00:56:36 -04:00
Jon Maddox 6afb846d04 avoid key errors 2015-10-07 00:56:14 -04:00
Jon Maddox ad549be353 support play_media for state restoration (for scenes) 2015-10-07 00:39:38 -04:00
Jon Maddox 9012ba53fd add play_media service to tests 2015-10-06 23:18:24 -04:00
Jon Maddox bdb42bf4a2 support play_media 2015-10-06 23:12:48 -04:00
Jon Maddox 1b22f71a19 implement play_media 2015-10-06 23:12:41 -04:00
Jon Maddox e84ddb036f return what playlist is playing 2015-10-06 23:12:30 -04:00
Jon Maddox 4be33bb15b add a way to play a playlist with the client 2015-10-06 23:12:20 -04:00
Jon Maddox d17174d43d play_media as a service 2015-10-06 23:11:21 -04:00
Jon Maddox e64846e2fd add ability to support play_media 2015-10-06 23:11:09 -04:00
Jon Maddox d454cad5a6 add a play_media function 2015-10-06 23:10:39 -04:00
Jon Maddox dcf52332ca add new properties for Channel or Playlist 2015-10-06 23:09:53 -04:00
Jon Maddox 87599df41b add some new media types 2015-10-06 23:00:29 -04:00
Tom Duijf e535f50e03 Merge branch 'master' into dev_tracker_snmp 2015-10-06 21:30:36 +00:00
Tom Duijf df7fbf664e Added constants needed for snmp 2015-10-06 21:27:04 +00:00
Tom Duijf 0fb9e1b16c Initial commit of snmp device tracker 2015-10-06 21:26:32 +00:00
Alan Bowman 047cff6596 Add blinkstick support 2015-10-06 11:10:16 +01:00
badele 32f1791c5a Check flake & pylint style 2015-10-06 08:44:15 +02:00
Paulus Schoutsen 3b49d1e876 Update version to 0.7.5dev0 2015-10-05 22:31:21 -07:00
Paulus Schoutsen 4d1dce2519 Merge branch 'dev' 2015-10-05 22:18:45 -07:00
Paulus Schoutsen 01d097b9b0 Bump version to 0.7.4 2015-10-05 22:18:34 -07:00
Alan Bowman 6d53944fa1 Support RGB colors 2015-10-05 13:25:09 +01:00
Paulus Schoutsen 7f60f1e662 Merge pull request #478 from balloob/dev
0.7.4rc1
2015-10-04 11:30:36 -07:00
Paulus Schoutsen bc6c285945 Update zone doc 2015-10-04 01:40:38 -07:00
Paulus Schoutsen d4d8c9ae65 Update frontend version 2015-10-04 01:40:38 -07:00
Paulus Schoutsen 9292891836 Update documentation 2015-10-04 01:40:38 -07:00
Paulus Schoutsen 035df68d6c Merge pull request #479 from balloob/balloob-patch-1
Tweak caching on CI
2015-10-03 11:41:14 -07:00
Paulus Schoutsen c611be96ad Another try, caching is enabled before activating virtualenv 2015-10-03 11:36:39 -07:00
Paulus Schoutsen d46720ee2c Tweak caching on CI 2015-10-03 11:31:28 -07:00
Paulus Schoutsen c1f464f478 Fix style issue 2015-10-03 11:26:57 -07:00
Paulus Schoutsen 8c5759e460 Improve Logbook device tracker locations handling 2015-10-03 11:20:22 -07:00
Paulus Schoutsen 8490d6126a OwnTracks robustness improvement 2015-10-03 10:29:00 -07:00
badele 7f71706f08 Log RFXCOM events 2015-10-03 11:26:18 +02:00
Paulus Schoutsen 8b5b580287 Merge pull request #477 from fabaff/worldclock
Worldclock sensor
2015-10-03 00:03:14 -07:00
Paulus Schoutsen d35f5b9f97 Tests for MQTT sensor/switch 2015-10-02 23:57:26 -07:00
Paulus Schoutsen 6de64d7695 Cache pip in Travis 2015-10-02 16:49:10 -07:00
Fabian Affolter 7f1da8b7bc Add worldclock sensor 2015-10-02 23:49:32 +02:00
Fabian Affolter 58ac4be24c Add worldclock sensor 2015-10-02 23:49:00 +02:00
Paulus Schoutsen b2919c6504 Fix gps accuracy issue 2015-10-02 13:49:55 -07:00
badele db509ccf18 Add a light & switch rfxtrx sender capability 2015-10-02 22:39:30 +02:00
Paulus Schoutsen 3863d2985a Merge pull request #475 from toddeye/group-state-openclose
Add STATE_OPEN/STATE_CLOSED to groupable states
2015-10-02 09:30:27 -07:00
Paulus Schoutsen 0180c056e1 Add away mode to heat control 2015-10-02 08:57:38 -07:00
Paulus Schoutsen e6cd9a6dc7 Merge pull request #459 from auchter/limitlessled-white
Add support for white LimitlessLED devices and multiple bridges
2015-10-02 08:55:34 -07:00
Todd Ingarfield 33028dd143 Add STATE_OPEN/STATE_CLOSED to groupable states 2015-10-02 10:53:36 -05:00
Paulus Schoutsen 9bdfa89b7c More robust geofence checking 2015-10-02 08:16:53 -07:00
Paulus Schoutsen 42b80868d4 Update netdisco dependency 2015-10-02 06:48:46 -07:00
Fabian Affolter 707ca4b752 Update docstrings 2015-10-02 13:42:06 +02:00
Fabian Affolter c7d2a09097 Update docstring 2015-10-02 13:41:51 +02:00
Fabian Affolter fb9f83f8ad Update docstrings 2015-10-02 13:17:18 +02:00
Michael Auchter 52ebb2fb3b limitlessled: Add support for White Limitless LED bulbs
LimitlessLED bulbs actually come in three flavors: RGB, RGBW, and White. The
ledcontroller library used to control these bulbs only supports RGBW and White
bulbs. This changelist adds support for the White bulb variant.

The White bulbs are a bit annoying in that they don't support absolute
brightness or color temperature adjustments; they only support a relative
"increase" or "decrease" adjustment. This, along with the unreliable, one-way
communication medium that requires repeats to be "sure" that the bulb received a
command, makes implementing brightness control difficult. So, for now, these
bulbs are more limited than the RGBW variants and only support On/Off control.
2015-10-01 22:38:50 -05:00
Michael Auchter ea7ca48ba2 limitlessled: Add support for previous configuration format
Quick hack that preserves functionality of existing configuration formats to
ease upgrades.
2015-10-01 22:38:50 -05:00
Michael Auchter ab80af099c limitlessled: Add support for multiple bridges
This adds support for a controlling multiple Limitless LED bridges.
2015-10-01 22:38:50 -05:00
Michael Auchter 34531895a0 limitlessled: Use LedControllerPool
This change is in preparation for adapting this component to support multiple
LimitlessLED bridges. Ultimately LedControllerPool helps to maintain the
mandatory 100ms pauses across multiple controllers so messages are reliably
received.
2015-10-01 22:38:50 -05:00
Michael Auchter 645cd89406 limitlessled: fix docstring 2015-10-01 22:38:49 -05:00
Paulus Schoutsen cc5217d818 Merge pull request #463 from adrienbrault/plex
Finish plex implementation
2015-10-01 18:30:24 -07:00
Adrien Brault e454806669 Finish plex implementation 2015-10-01 21:14:29 +02:00
Paulus Schoutsen 726557b2f6 Sensor.rest: verify SSL by default 2015-09-30 23:17:08 -07:00
Paulus Schoutsen c7e22e6910 Merge pull request #467 from adrienbrault/sensor-path-nossl
Allow to skip ssl and specify variable path for rest sensor
2015-09-30 23:14:24 -07:00
Adrien Brault f66a020bfc Allow to skip ssl and specify variable path for rest sensor 2015-10-01 05:54:31 +02:00
Paulus Schoutsen 64a73f6b67 Update pywemo dependency 2015-09-30 00:12:00 -07:00
Paulus Schoutsen ad7f034805 MQTT: Auto provide cloudmqtt cert 2015-09-30 00:09:35 -07:00
Paulus Schoutsen 76674d4de9 MQTT: Allow certificates 2015-09-30 00:09:07 -07:00
Paulus Schoutsen 0dc9f2a9f8 Move MQTT to own folder 2015-09-29 23:55:16 -07:00
Paulus Schoutsen ce47b58a8b Report MQTT connect issues 2015-09-29 23:34:17 -07:00
Paulus Schoutsen 5d71d5560e update rpi_gpio comment 2015-09-29 23:11:32 -07:00
Paulus Schoutsen 1dc9bfdf73 Update config zones 2015-09-29 23:08:37 -07:00
badele cc47e39006 Add send capability 2015-09-29 22:47:22 +02:00
Paulus Schoutsen 2eb36c18bd Add geofencing to automation 2015-09-29 00:18:52 -07:00
badele d64f0ddd41 Refactoring the code for pylint & flake test 2015-09-29 08:20:25 +02:00
Paulus Schoutsen 5ad27d8cdb Add support for zones to Home Assistant 2015-09-28 23:13:13 -07:00
Paulus Schoutsen 68c2b539ee More flexible domain config extraction 2015-09-28 23:09:05 -07:00
sfam e57b3ae847 add manual alarm 2015-09-28 23:36:46 +00:00
Paulus Schoutsen 755234369d New frontend build 2015-09-27 22:05:03 -07:00
Paulus Schoutsen 0a34e8de02 Fix services.yaml in packaging 2015-09-27 21:56:15 -07:00
Paulus Schoutsen 52ed25fc21 Merge pull request #394 from pavoni/hue-scenes
Fuzzy match for float attributes for Philips Hue scenes
2015-09-27 21:41:59 -07:00
Paulus Schoutsen 9e866680d4 Merge pull request #456 from balloob/service-fields
Service fields
2015-09-27 21:07:48 -07:00
pavoni 80c89d218b Avoid throwing an exception when a wemo device with attributes isn't found 2015-09-27 21:05:45 -07:00
Paulus Schoutsen 4f1bf7b2bf Merge pull request #443 from CCOSTAN/patch-2
Added some additional examples.
2015-09-27 20:48:01 -07:00
Paulus Schoutsen e557e355db Merge pull request #458 from AnthemisFoundry/fix_vera_dict
Fix Vera bug
2015-09-27 18:26:47 -07:00
badele 174aeacd76 Fix duplicate devices insertion 2015-09-27 23:51:19 +02:00
pavoni e7320fe969 Default dict if parent class returned None 2015-09-27 17:06:49 +01:00
badele 321a603bfe Add a light & switch rfxtrx support 2015-09-27 11:13:49 +02:00
Paulus Schoutsen 4e3bd5f2a9 Add service descriptions 2015-09-26 23:17:04 -07:00
Paulus Schoutsen 9a6b2c1831 Add utf-8 encoding to const file 2015-09-26 06:57:22 -07:00
sfam ca0b6ebd99 Merge pull request #397 from sfam/dev
Add MQTT alarm
2015-09-25 23:55:47 +01:00
sfam 47cd0b20a0 Merge branch 'persandstrom-sfam-dev' into dev 2015-09-25 17:02:37 +00:00
sfam 98d051f870 Merge branch 'sfam-dev' of https://github.com/persandstrom/home-assistant into persandstrom-sfam-dev 2015-09-25 17:02:20 +00:00
Carlo Costanzo 5f98705100 Changed the automation example
Changed the automation example to match the examples on the website.
2015-09-25 11:03:16 -04:00
pavoni 63bf4db969 Remove trace 2015-09-25 15:51:09 +01:00
pavoni 3ec00ce4fe Fix format errors 2015-09-25 15:49:56 +01:00
Paulus Schoutsen 74a0e47ba6 Update frontend with badge fixes 2015-09-25 07:44:58 -07:00
pavoni 476e4f0517 Add doc strings 2015-09-25 13:37:47 +01:00
pavoni 61fb8271e5 Change scene matching to use fuzzy logic for float values, if requested 2015-09-25 13:26:43 +01:00
Per Sandström 5cf9bd7223 updates to support ui 2015-09-25 06:23:04 +02:00
Paulus Schoutsen 9f986c55e6 Merge pull request #435 from toddeye/notify-smtp-retry
Added retry logic if the SMTP connection is disconnected by the server.
2015-09-24 17:15:05 -07:00
sfam 94eb54ff00 Merge branch 'dev' of https://github.com/balloob/home-assistant into dev 2015-09-24 21:19:21 +00:00
Per Sandström f28b392f1a Merge branch 'dev' of https://github.com/sfam/home-assistant into sfam-dev 2015-09-24 22:21:51 +02:00
Carlo Costanzo fa71d5fac9 Update configuration.yaml.example 2015-09-24 15:57:23 -04:00
Carlo Costanzo 21fd53b05d Added some additional examples.
- Added an eample of Groups within Groups.
- Took away the Automation 2 and used the new -Alias format.
- Added a second sensor to demonstrate sensor:, sensor 2: format.
2015-09-24 15:56:26 -04:00
Todd Ingarfield b0b3c2f73f formatting correction 2015-09-24 11:20:25 -05:00
Paulus Schoutsen d660d2b3dc Update frontend (group toggle updates) 2015-09-24 09:04:22 -07:00
Todd Ingarfield a89bfcf342 removed exception attributes 2015-09-24 10:55:24 -05:00
Todd Ingarfield a42347e6e7 corrected formating and style issues 2015-09-24 10:47:19 -05:00
Paulus Schoutsen faee3e8447 Merge pull request #360 from fabaff/rest-sensor
Rest sensor
2015-09-23 23:53:09 -07:00
Paulus Schoutsen 3625646c34 Fix reproduce_state 2015-09-23 23:35:08 -07:00
Paulus Schoutsen 5a562f3db8 Update frontend 2015-09-23 23:32:41 -07:00
Paulus Schoutsen 19705ab40a Hide auto groups from logbook 2015-09-23 23:20:20 -07:00
Paulus Schoutsen 20bf9f7ea1 Update frontend with group toggle 2015-09-23 23:20:20 -07:00
Paulus Schoutsen 6399c873f9 Add gps location to device tracker demo 2015-09-23 23:20:20 -07:00
Paulus Schoutsen 4be1053f1c Merge pull request #437 from balloob/handle-play-states
Support media_player Play States When Resolving/Reproducing State
2015-09-23 22:52:38 -07:00
Jon Maddox efdd0c9e8a don't break the chain 2015-09-24 01:35:08 -04:00
Jon Maddox 8d42e42230 style 2015-09-24 00:38:18 -04:00
Paulus Schoutsen 4b6878f91c Restrict data from stream API 2015-09-23 21:35:23 -07:00
Jon Maddox 90f35b35cd moar derp 2015-09-24 00:20:17 -04:00
Jon Maddox 082920abe0 moar constants 2015-09-24 00:20:05 -04:00
Jon Maddox 4a8bbc52e0 derp 2015-09-24 00:15:36 -04:00
Jon Maddox 1674c8309a Support playing, pausing states for media players when reproducing state
This allows the state helper to call the correct service call for
media_players when attempting to resolve state.
2015-09-24 00:06:05 -04:00
Paulus Schoutsen 62f016e7d2 Filter api password from arguments 2015-09-23 20:56:34 -07:00
Stefan Jonasson 34e5ecb8ab Merge pull request #433 from stefan-jonasson/fix_telldus_libary_cleanup
Telldus libary version update + added callback cleanup
2015-09-23 12:15:31 +02:00
Stefan Jonasson 8f95885e3a Codestyle cleanup 2015-09-23 11:47:53 +02:00
Stefan Jonasson 94db1ac142 Codestyle cleanup 2015-09-23 11:46:55 +02:00
Stefan Jonasson f48e65096a Removed logging. 2015-09-23 11:38:47 +02:00
Stefan Jonasson 3244975489 Removed logging. 2015-09-23 11:37:45 +02:00
Stefan Jonasson 10327795e9 Added more logging. 2015-09-23 11:34:20 +02:00
Stefan Jonasson bcbb8edd59 Added more logging. 2015-09-23 11:30:46 +02:00
Stefan Jonasson 86270e1a37 Added more logging. 2015-09-23 11:27:25 +02:00
Stefan Jonasson de7a34b648 Added more logging. 2015-09-23 11:25:08 +02:00
Stefan Jonasson 82a06279de Added more logging. 2015-09-23 11:22:32 +02:00
Stefan Jonasson 62af1fcc57 Added more logging. 2015-09-23 11:19:27 +02:00
Stefan Jonasson 6afe99dcc7 Added more logging. 2015-09-23 11:14:47 +02:00
Stefan Jonasson b6bf398859 Added callback logging. 2015-09-23 11:07:37 +02:00
Stefan Jonasson 48df06d1c0 Added callback logging. 2015-09-23 10:18:45 +02:00
Stefan Jonasson b4ca691822 Removed the check for callback_dispatcher 2015-09-23 09:52:58 +02:00
Stefan Jonasson 16c2827465 Removed the check for callback_dispatcher 2015-09-23 09:50:12 +02:00
Stefan Jonasson e90fd3d654 Removed the check for callback_dispatcher 2015-09-23 09:43:16 +02:00
Stefan Jonasson 7d0ff6884c Added the req consts 2015-09-23 09:32:11 +02:00
Stefan Jonasson a9ea8972dd Updated required tellcore version 2015-09-23 08:29:57 +02:00
Stefan Jonasson a0c1202ad6 Try to make the connection to the tellcore library more stable 2015-09-23 08:26:40 +02:00
Fabian Affolter 1bf45c8f33 Merge branch 'rest-sensor' of github.com:fabaff/home-assistant into rest-sensor 2015-09-23 01:25:53 +02:00
Fabian Affolter c5094438de Add post option, correction_factor, and decimal_places 2015-09-23 01:17:28 +02:00
Fabian Affolter 60d45ebf79 Add return value 2015-09-23 01:17:28 +02:00
Fabian Affolter 5df2a1cf76 Add new checks and move var check to setup 2015-09-23 01:17:28 +02:00
Fabian Affolter f5b2fa6fbe Remove left-over 2015-09-23 01:17:28 +02:00
Fabian Affolter 03b2ced24e Add rest sensor 2015-09-23 01:17:28 +02:00
Fabian Affolter 6c18f264f3 Add rest sensor 2015-09-23 01:17:28 +02:00
sfam cdc371c3ee merge requires_code and code_format properties 2015-09-22 21:40:45 +00:00
Heiko Rothe 1553844279 Added support for the newest tp-link firmware
Currently this seemingly only applies to the Archer C9
2015-09-22 22:48:43 +02:00
Paulus Schoutsen 826b3be087 Update coveragerc 2015-09-22 13:25:18 -07:00
Paulus Schoutsen f5000d401b Merge pull request #430 from CCOSTAN/patch-1
Minor comment about weather components & LONG:LAT.
2015-09-22 13:11:24 -07:00
Carlo Costanzo 7443f4faf8 Minor comment about weather components & LONG:LAT.
Super Small edit adding in a # about the weather related information.
2015-09-22 15:53:16 -04:00
Heiko Rothe 582ed1fc8d Merge remote-tracking branch 'balloob/dev' into dev 2015-09-22 19:48:39 +02:00
Malte Deiseroth ef76047ba2 new try to add everythin from the stylecheckers 2015-09-22 13:27:08 +02:00
Malte Deiseroth d475e5362b respect flake8 errors 2015-09-22 12:53:44 +02:00
Malte Deiseroth 3027b4a5a8 respect pylint suggestions 2015-09-22 12:32:45 +02:00
Malte Deiseroth 3829abbd2d updated with remote 2015-09-22 12:18:00 +02:00
Malte Deiseroth e6e3b37a62 merged with current dev 2015-09-22 12:11:57 +02:00
Paulus Schoutsen 3158db9553 Update tile provider 2015-09-21 23:19:42 -07:00
Paulus Schoutsen 46a0173e31 Add demo device tracker platform 2015-09-21 22:46:08 -07:00
Paulus Schoutsen 7e511bcacf Fix iPhone map issues 2015-09-21 22:23:17 -07:00
Paulus Schoutsen d7fd2ccdaf Merge pull request #316 from fabaff/systemd
Systemd service unit file
2015-09-21 19:45:12 -07:00
Todd Ingarfield b2999ae325 Added retry logic if the SMTP connection is disconnected by the server. 2015-09-21 18:54:30 -05:00
Per Sandström 5033c1fcb7 Merge branch 'dev' of https://github.com/sfam/home-assistant into sfam-dev 2015-09-21 21:18:46 +02:00
Jeff Schroeder e492be299b Merge pull request #417 from miniconfig/plex-dev
Plex media player component
2015-09-21 11:44:33 -05:00
miniconfig 03e7281406 Moved plexapi import into setup_platform().
Changed CONTRIBUTING.md to refer to requirements_all.txt instead of requirements.txt
2015-09-21 11:59:55 -04:00
miniconfig 16d75b2981 Added plexapi library to requirements_all.txt 2015-09-21 11:45:52 -04:00
miniconfig cc7784889a Pylint errors 2015-09-21 11:11:38 -04:00
miniconfig d267f0a04c Removed references to the frontend device parameter in the directions and added some clarification.
Fixed plexapi version number.
2015-09-21 10:59:34 -04:00
miniconfig a8e0ca6d3f Fixed various property methods to make sure they all had a fall through return and removed unnecessary "else" statements 2015-09-21 10:44:24 -04:00
Stefan Jonasson f8175adbdc Merge pull request #420 from stefan-jonasson/dev
Fixed Pylint issue
2015-09-21 13:03:16 +02:00
Stefan Jonasson 6437f6f6b4 Desperate try to fix travis ci reporting a unused-argument 2015-09-21 12:57:11 +02:00
Paulus Schoutsen 27bbfbae62 Fix compilation issue frontend 2015-09-21 00:42:23 -07:00
Stefan Jonasson 2785c373fb E302 expected 2 blank lines, found 1 2015-09-21 08:26:14 +02:00
Paulus Schoutsen acddae3747 Initial support for maps in frontend 2015-09-20 23:14:58 -07:00
Stefan Jonasson d3e9a22759 Added pylint hint! 2015-09-21 08:14:11 +02:00
Paulus Schoutsen ca698ff063 remove debug statement 2015-09-20 20:24:31 -07:00
Paulus Schoutsen a866d515f7 Make owntracks more robust 2015-09-20 20:09:53 -07:00
Paulus Schoutsen 3af4f267b3 Lint script would incorrectly report success 2015-09-20 19:56:10 -07:00
Paulus Schoutsen bd61555698 discovery: Update to netdisco 0.4.1 2015-09-20 19:46:33 -07:00
miniconfig 5027acfda1 Fixed additional pylint and flake issues 2015-09-20 16:13:26 -04:00
stefan-jonasson f0991d63d1 Merge pull request #416 from stefan-jonasson/dev
Fix states not updating after command was sent!
2015-09-20 22:00:12 +02:00
Stefan Jonasson 34f36479c6 Fix states not updating after command was sent! 2015-09-20 21:29:38 +02:00
Paulus Schoutsen 506c88dbaf Fix owntracks bugs 2015-09-20 12:13:51 -07:00
Paulus Schoutsen 98a1addc18 Merge pull request #413 from balloob/owntracks
initial owntracks support
2015-09-20 12:00:11 -07:00
Paulus Schoutsen 30492cc685 Fix tests and linting 2015-09-20 11:46:01 -07:00
Paulus Schoutsen 0d09e2e1df Attempt to fix CI scripts 2015-09-20 11:00:35 -07:00
Paulus Schoutsen 81085c7467 Merge pull request #414 from stefan-jonasson/telldus_callback_fix
Telldus callback fix
2015-09-20 10:25:34 -07:00
Paulus Schoutsen 19d40612e6 Add home_range to device tracker 2015-09-20 09:35:03 -07:00
miniconfig 48306ddbf6 Fixed Requirements URL 2015-09-20 08:19:21 -04:00
Stefan Jonasson a60a9202a5 cleanup 2015-09-20 14:17:32 +02:00
Stefan Jonasson ab81231e6d Changed flow so we got one callback per platorm instead of per device which caused race conditions in the telldus library. 2015-09-20 14:11:42 +02:00
Paulus Schoutsen 68286dcef8 initial owntracks support 2015-09-20 00:27:50 -07:00
Paulus Schoutsen 6e96f915f6 Merge pull request #411 from stefan-jonasson/tellstick_callbacks
Fix for issue: #204
2015-09-19 22:54:48 -07:00
Paulus Schoutsen 620a7eadf4 Add release script 2015-09-19 21:33:24 -07:00
Paulus Schoutsen 2332548cf4 Update version to 0.7.4dev 2015-09-19 21:19:45 -07:00
Paulus Schoutsen dc55525206 Merge branch 'dev' 2015-09-19 21:19:20 -07:00
Paulus Schoutsen 9318b36ac2 0.7.3 release 2015-09-19 21:17:10 -07:00
Paulus Schoutsen 46f6653183 New version frontend 2015-09-19 21:16:47 -07:00
Paulus Schoutsen 9736761968 Merge pull request #412 from balloob/dev
0.7.3rc2
2015-09-19 21:07:24 -07:00
Paulus Schoutsen 6352f10d9e Device tracker minor tweak 2015-09-19 21:02:54 -07:00
Paulus Schoutsen 2a3b911d7b Remove debug statement 2015-09-19 21:02:38 -07:00
Paulus Schoutsen 720e5876a7 Fix broken automation test 2015-09-19 21:02:28 -07:00
Paulus Schoutsen 85489010bc Merge pull request #404 from stefan-jonasson/automation_confg_list
Automation confg lists
2015-09-19 20:53:26 -07:00
Stefan Jonasson 60d8266ce0 Fix for issue:
Tellstick switches status changes aren't realtime #204
2015-09-20 00:57:04 +02:00
sfam e29deb0202 add a code_format property on alarm object and a optional code for its MQTT platform 2015-09-19 22:22:37 +00:00
Paulus Schoutsen 268b0f17d0 Merge pull request #409 from persandstrom/initd_restart
hass-daemon restart fix
2015-09-19 14:32:19 -07:00
Per Sandström 49ce85f2e4 fixed restart 2015-09-19 22:45:30 +02:00
Paulus Schoutsen 1771f8b1b3 Fix logbook crashing on custom state_changed events 2015-09-19 13:13:28 -07:00
Paulus Schoutsen 8cd1c42e80 Merge pull request #407 from balloob/testing-upgrade
Fix CI
2015-09-19 12:55:09 -07:00
Paulus Schoutsen ec1d5e617e Fix CI 2015-09-19 12:29:23 -07:00
Stefan Jonasson 40651ef2bc Fixed old config value conversion
Added a new unit test for the config list mode
2015-09-19 21:13:09 +02:00
miniconfig 64741a95b8 Added requirements 2015-09-19 14:16:57 -04:00
miniconfig a24b38aacc Initial version of plex media player component 2015-09-19 13:48:45 -04:00
Paulus Schoutsen 55f6ff86e4 Merge pull request #405 from balloob/automation-event
Event automation fuzzy matches on data
2015-09-19 10:43:02 -07:00
Paulus Schoutsen 79cdda2bd9 Merge pull request #406 from balloob/automation-action-config
Change automation action config keys
2015-09-19 10:42:37 -07:00
sfam 35eed93443 add a requires_code property on alarm object 2015-09-19 17:32:37 +00:00
Paulus Schoutsen dd4e1cbd1d Change automation action config keys 2015-09-19 08:43:56 -07:00
Stefan Jonasson 2084976bc2 Fixed suggestions from @balloob 2015-09-19 17:42:21 +02:00
Paulus Schoutsen 9019d654d7 Event automation fuzzy matches on data 2015-09-19 08:27:34 -07:00
Paulus Schoutsen e0f6239ef3 Merge pull request #403 from stefan-jonasson/script_entity_id_buggfix
Buggfix consistent configuration for scripts calling scripts
2015-09-19 08:20:23 -07:00
Stefan Jonasson b9e1b3eb99 Fixed var name + flake8 2015-09-19 15:51:50 +02:00
Stefan Jonasson e1a7b8f988 Merge branch 'dev' of https://github.com/balloob/home-assistant into automation_confg_list 2015-09-19 15:27:46 +02:00
Stefan Jonasson be9cfbdeb0 Fixed docblock 2015-09-19 14:45:56 +02:00
Fabian Affolter a32229b4ce Allow decimal numbers (Thanks @luxus) 2015-09-19 11:48:24 +02:00
Paulus Schoutsen 7da104af4e Merge pull request #399 from persandstrom/redirect_output
remove output in terminal after service is started
2015-09-18 15:47:33 -07:00
Per Sandström 9d7aef94e0 remove output in terminal after service is started 2015-09-18 21:51:24 +02:00
Stefan Jonasson e4c5108c9d Implemented configuration loading from 2015-09-18 18:12:27 +02:00
sfam fc946da5db Add MQTT alarm 2015-09-18 15:30:34 +00:00
Fabian Affolter b33714bca3 Fix default value for correction_factor (Thanks @luxus) 2015-09-18 16:41:35 +02:00
Fabian Affolter 722af9014d Update import style 2015-09-18 16:25:52 +02:00
pavoni 6abaebb248 More consistant naming 2015-09-18 14:40:00 +01:00
pavoni c01e9bea2b Fix inconsistant naming 2015-09-18 14:38:15 +01:00
Fabian Affolter 5ce4ade737 Add user and change config dir 2015-09-18 14:18:49 +02:00
Fabian Affolter 9ce8f385d2 Rename service unit file 2015-09-18 14:15:42 +02:00
Fabian Affolter d7464aea86 Initial systemd service unit file 2015-09-18 14:14:10 +02:00
Fabian Affolter 071952462c initial systemd service unit file 2015-09-18 13:49:46 +02:00
pavoni ab79b8a541 First cut of write after set for scenes 2015-09-18 12:34:24 +01:00
pavoni 3a3374ed4b Remove incorrect change 2015-09-18 12:34:02 +01:00
pavoni 4d53fa0173 First draft of read_after_set for scenes 2015-09-18 12:21:08 +01:00
pavoni 5369d8c61c Merge remote-tracking branch 'upstream/dev' into dev 2015-09-18 08:51:54 +01:00
Paulus Schoutsen 6c1f44242c Update setup script 2015-09-17 23:55:47 -07:00
Paulus Schoutsen 4371355be1 Better errors on time automation trigger 2015-09-17 23:12:55 -07:00
Paulus Schoutsen 5bb88909a0 Merge pull request #392 from balloob/test-runner
Use pytest for running tests
2015-09-17 19:21:33 -07:00
Paulus Schoutsen 4b0c416844 Use pytest for running tests 2015-09-17 09:08:58 -07:00
Paulus Schoutsen 737d7c9d22 Add travis install section back 2015-09-17 08:54:56 -07:00
Paulus Schoutsen 15be5ced9a Merge pull request #391 from balloob/scripts-to-rule-them-all
First pass for scripts to rule them all
2015-09-17 08:49:41 -07:00
Paulus Schoutsen 7c549db2d6 Merge pull request #386 from SEJeff/quiet-logging
[RFC] Quiet logging
2015-09-17 08:48:00 -07:00
Paulus Schoutsen 6e6aa15f7c Merge pull request #390 from balloob/restart-osx
Add a Way to Restart on OS X
2015-09-17 08:42:54 -07:00
Jon Maddox e0c1885a71 add blank line 2015-09-17 03:52:04 -04:00
Paulus Schoutsen 049cd159ce Fix dev dependency pytest 2015-09-17 00:44:22 -07:00
Paulus Schoutsen 95e05d4fc9 Make script/bootstrap_server executable 2015-09-17 00:42:15 -07:00
Paulus Schoutsen bf14067eb0 Add exec + doc header 2015-09-17 00:38:52 -07:00
Paulus Schoutsen 8c77418b6a First pass for scripts to rule them all 2015-09-17 00:35:26 -07:00
Jon Maddox d25a42426a add a way to restart on os x 2015-09-17 03:25:36 -04:00
Paulus Schoutsen 3ed102cd88 Merge pull request #388 from stefan-jonasson/dev
[Bugfix] - Time trigger fired all the time when using the "from" param
2015-09-17 00:10:13 -07:00
Stefan Jonasson 90e2aefd23 flake8 fix 2015-09-17 08:55:17 +02:00
Stefan Jonasson 47af247d6a flake8 fix 2015-09-17 08:39:41 +02:00
Paulus Schoutsen 3947ed3c2b Merge pull request #389 from balloob/pip-fixes
Fix pip not detecting package installed
2015-09-16 23:38:59 -07:00
Stefan Jonasson 1a00d4a095 pylint fix 2015-09-17 08:35:18 +02:00
Fabian Affolter ccecc0181d Remove blank line 2015-09-17 08:34:26 +02:00
Fabian Affolter e90dbad37e Update docstrings 2015-09-17 08:34:10 +02:00
Fabian Affolter 8ec0c36457 Fix return value 2015-09-17 08:29:50 +02:00
Stefan Jonasson e68cc83e64 return and output error if none of the 4 keys provided
only parse hour/minute/second if after is not available
2015-09-17 08:24:06 +02:00
Paulus Schoutsen 4ad4d74ed4 Fix pip not detecting package installed 2015-09-16 23:18:47 -07:00
Jeff Schroeder 550f31d4c3 Quiet down some of the logging in the sonos platform
This is due to the soco library logging very excessively and it using
requests to connect to each Sonos speaker every 10 seconds (by default).

This makes the logs much more pleasant to use for finding real issues.
2015-09-16 23:11:57 -05:00
Jeff Schroeder 7e42b35b62 Set logging of SQL queries to sqlite as debug log messages 2015-09-16 23:11:57 -05:00
Stefan Jonasson 9b96471182 Fixed after param 2015-09-16 22:46:21 +02:00
Paulus Schoutsen 3c3eadbef5 Update frontend with alarm ui 2015-09-16 08:59:42 -07:00
Paulus Schoutsen f375bc527a Merge pull request #358 from persandstrom/alarmui
Alarm Control Panel
2015-09-16 08:56:03 -07:00
Malte Deiseroth ce501ae627 Improved onewire configuration 2015-09-16 14:17:41 +02:00
deisi b6f954e082 Changed handling of config file
I tried to implement your suggesteions for the default handlig of the device names. I think this way, everything you wanted is in.
2015-09-16 10:18:11 +02:00
deisi b368388714 Update .gitignore 2015-09-16 08:49:12 +02:00
Paulus Schoutsen 6de04d78ed Merge pull request #381 from heathbar/foscam-support
Foscam support
2015-09-15 23:37:33 -07:00
Paulus Schoutsen 86aea83f64 Device tracker improvements 2015-09-15 23:35:28 -07:00
Malte Deiseroth 8842e4e94f gitignore ready for emacs 2015-09-16 08:34:08 +02:00
Heath Paddock 98feb3cd93 Fixed pylint errors 2015-09-16 00:40:51 -05:00
Paulus Schoutsen 5af1643297 Add warning when entity not found in reproduce_state 2015-09-15 22:23:07 -07:00
Heath Paddock 3dcd18af9e Fixed flake8 errors 2015-09-16 00:09:16 -05:00
Heath Paddock 2fd7b98cab minor code cleanup 2015-09-15 23:45:12 -05:00
Heath Paddock 90e21791f6 Removed obsolete code 2015-09-15 23:39:03 -05:00
Heath Paddock 9678613a13 foscam: made 'port' configurable and added additional documentation 2015-09-15 23:32:55 -05:00
Heath Paddock 5de89316b2 Initial implementation of Foscam FI9821W support 2015-09-15 22:58:46 -05:00
Paulus Schoutsen 95eabe7c0e Freeze time for sun automation test 2015-09-15 20:18:24 -07:00
Paulus Schoutsen 9bec0316ea Merge pull request #380 from balloob/better-itunes-speaker-names
Append 'AirTunes Speaker' to Name of Devices Shared via itunes-api MediaPlayer
2015-09-15 18:53:47 -07:00
Jon Maddox 61685ea13d tag on " AirTunes Speaker" instead 2015-09-15 21:40:39 -04:00
Jon Maddox 77b9a12687 Tags the name of the device to the end of the name
This helps the media player be more explicit about itself and what it
is. It also namespaces it self a little better in the system. Rather
than be `media_player.family_room` it is
`media_player.family_room_apple_tv`. This helps for cases when there’s
another actual media player like Kodi or Chromecast in there.
2015-09-15 21:07:49 -04:00
Paulus Schoutsen 08f2a67de4 Allow falsy values for media player attributes 2015-09-15 12:58:19 -07:00
Paulus Schoutsen 58c3b03b79 Merge pull request #377 from balloob/automation-improvements
Automation improvements
2015-09-15 12:46:13 -07:00
Paulus Schoutsen c18294ee76 Allow triggers to be used as condition 2015-09-15 08:56:06 -07:00
pavoni 408f0cff78 Merge remote-tracking branch 'upstream/dev' into dev 2015-09-15 14:30:01 +01:00
Paulus Schoutsen 0584c10ef9 Style fix 2015-09-15 00:11:24 -07:00
Paulus Schoutsen ae527e9c6f Fix broken sun automation test 2015-09-15 00:07:49 -07:00
Paulus Schoutsen 1ec5178f66 Remove scheduler component 2015-09-15 00:05:20 -07:00
Paulus Schoutsen 2978e0dabe Add sun automation trigger 2015-09-15 00:02:54 -07:00
Paulus Schoutsen e26f0f7b7d Update stale header doc 2015-09-15 00:02:46 -07:00
Paulus Schoutsen 2ff2a78e97 Merge pull request #376 from balloob/launchd
launchd Script for Starting at Boot and Backgrounding on OS X
2015-09-15 00:02:11 -07:00
Jon Maddox bb172d8c98 indention 2015-09-15 02:58:13 -04:00
Jon Maddox acb288f9e7 error handling when writing 2015-09-15 02:54:22 -04:00
Jon Maddox c7565baa6d NOPE 2015-09-15 02:54:11 -04:00
Jon Maddox fb29611c15 🔥 codecs 2015-09-15 02:51:23 -04:00
Jon Maddox 37cd62447e let it get overwritten 2015-09-15 02:50:15 -04:00
Jon Maddox 5cbcd72912 dupe 2015-09-15 02:48:23 -04:00
Jon Maddox 8bba0b88fd blocks! 2015-09-15 02:46:06 -04:00
Paulus Schoutsen b1f17c2cd4 Merge pull request #356 from fabaff/command-sensor
Command sensor
2015-09-14 23:46:02 -07:00
Fabian Affolter 8017f7f241 Merge branch 'command-sensor' of github.com:fabaff/home-assistant into command-sensor 2015-09-15 08:42:47 +02:00
Fabian Affolter 1a73c1b991 Fix pylint issue 2015-09-15 08:40:54 +02:00
Fabian Affolter 039c5cd847 Change import ordering 2015-09-15 08:40:38 +02:00
Jon Maddox 3b27bef1ac DOCS 2015-09-15 02:35:20 -04:00
Jon Maddox 1fc2204ca9 get the right path 2015-09-15 02:30:19 -04:00
Jon Maddox 834ce5269d we don't actually have to do this 2015-09-15 02:30:13 -04:00
Jon Maddox 9ada5e6b2b move launchd script inside package 2015-09-15 02:29:57 -04:00
Paulus Schoutsen f17ef0327c Merge pull request #366 from fabaff/glances
Glances sensor
2015-09-14 23:24:20 -07:00
Fabian Affolter 56a151b196 Add return value 2015-09-15 08:21:58 +02:00
Jon Maddox 6e927d68e5 don't need these anymore 2015-09-15 02:20:40 -04:00
Jon Maddox fcad068016 strip the dash 2015-09-15 02:17:01 -04:00
Jon Maddox e12cc2fbbf attempts at dodging pep8 terror 2015-09-15 02:12:31 -04:00
Jon Maddox 9588fcc5cc install scripts 2015-09-15 02:09:02 -04:00
Jon Maddox a4aa2e4383 change vars 2015-09-15 02:08:43 -04:00
Fabian Affolter fe074835f0 Fix pylint issue 2015-09-15 07:56:08 +02:00
Paulus Schoutsen b2ad8db86b Add condition type to automation component 2015-09-14 22:51:28 -07:00
Paulus Schoutsen 20f021d05f Another style fix. Who comes up with this? 2015-09-14 22:14:15 -07:00
Paulus Schoutsen fc43135ddd Style fix 2015-09-14 22:12:51 -07:00
Jon Maddox e86ee9eae7 install/uninstall scripts for OS X 2015-09-15 01:07:25 -04:00
Jon Maddox 332f7621ce launchd script for loading HA at boot and background on OS X 2015-09-15 01:06:31 -04:00
Paulus Schoutsen 68c1dd7cd4 Refactor automation configuration 2015-09-14 22:05:40 -07:00
Paulus Schoutsen fe2a9bb83e Fix numeric state if 2015-09-14 20:46:57 -07:00
Paulus Schoutsen 2f8591205f Merge pull request #375 from SEJeff/fix-asuswrt
Fix the asuswrt device tracker for dhcp leases with no hostname
2015-09-14 20:23:44 -07:00
Paulus Schoutsen 65c3184856 Merge pull request #373 from SEJeff/fix-sensor-entity-names
Make the entity names for systemmonitor sensors a bit nicer
2015-09-14 20:17:01 -07:00
Jeff Schroeder 0afb6114c5 Make the entity names for systemmonitor sensors a bit nicer
This prevents them from having trailing whitespace, which makes them
end with `_`.
2015-09-14 21:20:41 -05:00
Jeff Schroeder 7c7b6ca05c Fix the asuswrt device tracker for dhcp leases with no hostname
Sometimes, hosts request dhcp leases without sending the hostname
they want to the dhcp server. This results in the entity_id being
`device_tracker.` as the dev_id is empty and things go downhill
from there.

The dhcp lease file looks like:
    admin@RT-AC66R:/tmp/home/root# cat /var/lib/misc/dnsmasq.leases
    86400 5c:c5:d4:79:4c:ad 192.168.1.226 chit-jsl3 *
    85242 8c:77:12:ad:d9:23 192.168.1.126 android-2c94abebaab16255 01:8c:77:12:ad:d9:23
    61985 b8:e9:37:73:47:f0 192.168.1.204 * 01:b8:e9:37:73:47:f0
    61982 b8:e9:37:ec:0d:7e 192.168.1.132 * 01:b8:e9:37:ec:0d:7e
    84584 00:20:6b:ca:31:c1 192.168.1.182 MC4650-CA31C1 01:00:20:6b:ca:31:c1
    86306 fc:e9:98:d6:4b:90 192.168.1.173 iLol 01:fc:e9:98:d6:4b:90
    74343 20:3a:07:f3:7e:ae 192.168.1.246 gatekeeper 01:20:3a:07:f3:7e:ae
    72374 b8:e9:37:5f:3d:06 192.168.1.34 SonosZP 01:b8:e9:37:5f:3d:06
    64697 00:0e:58:6f:59:d2 192.168.1.171 SonosZB 01:00:0e:58:6f:59:d2

Confirmed working on an Asus RT-AC66R with fw version: 3.0.0.4.376_3861
2015-09-14 20:33:14 -05:00
Paulus Schoutsen 2fe8b154f1 Fix state automation configuration 2015-09-14 18:22:49 -07:00
Paulus Schoutsen bf64956265 Merge pull request #368 from stefan-jonasson/dev
Implemented the if condition support in numeric state
2015-09-14 17:57:34 -07:00
Paulus Schoutsen eb11486e76 Merge pull request #370 from balloob/airplay-speakers
Add AirPlay Speakers as media_players
2015-09-14 16:22:09 -07:00
Jon Maddox e8c3eaab33 style tweaks 2015-09-14 17:39:43 -04:00
Jon Maddox fcbeddeb57 describe airplay part 2015-09-14 17:34:57 -04:00
Jon Maddox 50b23e1969 adds airplay speakers as media_players 2015-09-14 17:27:00 -04:00
Fabian Affolter 984f01359c Fix docstring 2015-09-14 21:48:29 +02:00
Stefan Jonasson d5198d4242 Implemented the if condition support in numeric state 2015-09-14 20:33:01 +02:00
Per Sandström f5d1da1d53 and pylint... 2015-09-14 19:42:36 +02:00
Per Sandström 13ca42e187 fixes from review 2015-09-14 17:33:43 +02:00
Fabian Affolter 74eb577c58 Add glances sensor 2015-09-14 14:09:24 +02:00
Fabian Affolter fe7134b897 Add glances sensor 2015-09-14 14:08:30 +02:00
Fabian Affolter 27845d3fc5 Allow decimal places to be set 2015-09-14 10:44:07 +02:00
Fabian Affolter 6606d2a73c Add command sensor 2015-09-14 10:07:27 +02:00
Fabian Affolter 6dc877d8de Add command sensor 2015-09-14 10:07:27 +02:00
Fabian Affolter b0441aadc4 Add new checks and move var check to setup 2015-09-14 10:06:40 +02:00
Paulus Schoutsen dd71e4fdd1 Record in logbook when automation triggered 2015-09-14 00:02:33 -07:00
Fabian Affolter 7e066e11ad Remove left-over 2015-09-14 08:55:20 +02:00
Paulus Schoutsen 13d40fe6ec Allow firing events in script 2015-09-13 23:54:48 -07:00
Paulus Schoutsen 7e75add144 Update nmap dependency 2015-09-13 23:35:12 -07:00
Paulus Schoutsen 2df26a0d1a Fix sensor.systemmonitor 2015-09-13 23:29:13 -07:00
Paulus Schoutsen 965730eb60 Allow setting name for command switch 2015-09-13 23:04:49 -07:00
Paulus Schoutsen 4c0ac6051f Merge pull request #364 from balloob/automation-if
Add if-condition to automation
2015-09-13 23:00:50 -07:00
Paulus Schoutsen 2a11d02fe4 Add if to automation 2015-09-13 22:27:27 -07:00
Paulus Schoutsen 046c5653cb Add latest version of polymer repo 2015-09-13 20:58:22 -07:00
Paulus Schoutsen f86fcdcaf5 Merge pull request #363 from balloob/logbook-entry
Add custom entries to logbook
2015-09-13 20:52:09 -07:00
Paulus Schoutsen 835bc1c492 Fix style issue 2015-09-13 18:40:54 -07:00
Paulus Schoutsen de5a2fee83 Add custom entries to logbook 2015-09-13 18:30:44 -07:00
Roy Hooper 209499e82b Reduce media player scan frequency to 10s 2015-09-13 20:54:20 -04:00
Roy Hooper 9b47241a46 switch to default polling cycle to solve multiple instance issue 2015-09-13 20:49:09 -04:00
Paulus Schoutsen 513f6e9c3c Merge pull request #353 from stefan-jonasson/dev
numeric_state automation platform
2015-09-13 17:13:06 -07:00
Paulus Schoutsen 9582eae48e Merge pull request #359 from rhooper/sonos-netdisco-fix
Prevent duplicate instances of sonos devices during netdisco
2015-09-13 13:56:10 -07:00
Roy Hooper d4834ff408 Add hass property to Entity to prevent 'Attribute hass is None' error during self.update_ha_state 2015-09-13 16:53:31 -04:00
Roy Hooper ce22f3c82d Implement unique_id to prevent duplicate devices 2015-09-13 16:53:31 -04:00
Fabian Affolter 246184507c Add rest sensor 2015-09-13 22:41:37 +02:00
Fabian Affolter 3f3b475d76 Add rest sensor 2015-09-13 22:41:16 +02:00
Fabian Affolter 40aa661340 Update docsstring 2015-09-13 22:27:28 +02:00
Per Sandström 6c3a78df30 fixed spelling 2015-09-13 21:07:16 +02:00
Per Sandström 964a1f9aef merge from dev 2015-09-13 21:00:51 +02:00
Stefan Jonasson 8360ab265c Not used to pylint and flake8 ... 2015-09-13 20:34:45 +02:00
Stefan Jonasson e3dcb45879 Fixed pylint error 2015-09-13 20:27:11 +02:00
Per Sandström 683a80f5f4 tests pass 2015-09-13 20:21:02 +02:00
Stefan Jonasson 9904727cde homeassistant/components/automation/numeric_state.py:61:80: E501 line too long (80 > 79 characters)
The command "flake8 homeassistant" exited with 1.
2015-09-13 20:16:51 +02:00
Stefan Jonasson e9da02d70c Fixed value error exception
Fixed unittest
2015-09-13 19:59:26 +02:00
Paulus Schoutsen b0b88e606c Merge pull request #355 from SEJeff/minor-sonos-fix
Minor sonos fix
2015-09-13 10:17:05 -07:00
Jeff Schroeder 57a833f1a7 Fix a bug which causes the sonos component to occasionally pop
Had this happen when Sonos surround sound is playing from a TV. See this
for more details:

https://github.com/SoCo/SoCo/blob/af9a5152fe942fc665b0269b0f245330db0671ec/soco/core.py#L1060
2015-09-13 12:13:35 -05:00
Paulus Schoutsen e5e577108c Merge pull request #357 from balloob/sonos-discovery
Discover sonos devices
2015-09-13 08:16:09 -07:00
Paulus Schoutsen 51dd718282 Fix broken thermostat demo and prevent happening again 2015-09-13 08:08:46 -07:00
Paulus Schoutsen 40340ea832 Discover sonos devices 2015-09-13 07:48:50 -07:00
Stefan Jonasson a2ca60159d Fixed logic 2015-09-13 13:05:36 +02:00
Stefan Jonasson 50f5f1860c Added a numeric_state automation platform test ( UNTESTED ) 2015-09-13 12:53:37 +02:00
Stefan Jonasson 8e89308a15 Added better handling if we did not get a value for the numeric check 2015-09-13 12:15:21 +02:00
Paulus Schoutsen 96cfff192a Fix space after HA started in logbook 2015-09-13 01:21:30 -07:00
Paulus Schoutsen 067993c8ab Logbook reverse sorting 2015-09-13 01:12:05 -07:00
Paulus Schoutsen eef1e65244 Fix converting config device tracker 2015-09-13 00:48:52 -07:00
Paulus Schoutsen 134c870d2b Merge pull request #345 from balloob/device-tracker
Device tracker rewrite
2015-09-13 00:15:30 -07:00
Paulus Schoutsen 5edc4f148f Fix style 2015-09-13 00:10:59 -07:00
Paulus Schoutsen 880b5f0ad1 Add device_tracker.see service 2015-09-13 00:02:28 -07:00
Paulus Schoutsen 804b7669b7 Setup device tracker group at end of init 2015-09-12 23:08:16 -07:00
Paulus Schoutsen 81288cc988 Remove netgear discovery hack 2015-09-12 23:08:00 -07:00
Paulus Schoutsen d4174f5e42 Fix device sun light trigger tests 2015-09-12 22:57:31 -07:00
Paulus Schoutsen cfc23b0091 Speed up tests 2015-09-12 22:56:49 -07:00
Paulus Schoutsen bb42e264cb Device tracker sets up group again 2015-09-12 22:56:31 -07:00
Per Sandström c9bccadc40 fixed merge error 2015-09-13 07:48:34 +02:00
Per Sandström ab6cb43d5b alarm component 2015-09-13 07:42:38 +02:00
Jeff Schroeder 4fa379419d Don't blow up if no sonos speakers are found
Also move the imports up so the latest pep8 doesn't complain
2015-09-12 23:10:24 -05:00
Paulus Schoutsen b01ff81b47 Merge pull request #354 from rhooper/sonos
squash bug in volume_level (bad if statement)
2015-09-12 18:47:06 -07:00
Roy Hooper 6dcb87c54d squash bug in volume_level (bad if statement) 2015-09-12 21:42:36 -04:00
Paulus Schoutsen 6cfca09daf Merge pull request #352 from SEJeff/minor-fixes
A few minor bugfixes
2015-09-12 13:52:37 -07:00
Stefan Jonasson 4eba1250e9 Added a numeric_state automation platform 2015-09-12 21:42:52 +02:00
Jeff Schroeder d4d798d71f Error gracefully when unable to connect to home.nest.com 2015-09-12 14:27:12 -05:00
Jeff Schroeder 3dc1dc6c6a A few minor cleanups in the http debug api server 2015-09-12 14:27:07 -05:00
Jeff Schroeder 473047f3dd Fix a small tyop in the history component 2015-09-12 14:27:03 -05:00
Jeff Schroeder f5b5d3f65a Use str.split maxsplit in the time component 2015-09-12 14:26:59 -05:00
Jeff Schroeder 776c7dae07 Fix a tyop in the arduino switch component 2015-09-12 14:26:55 -05:00
Paulus Schoutsen 4ccedca3e5 Fix tests for device tracker 2015-09-12 09:15:28 -07:00
Paulus Schoutsen d9b97ad5b4 Merge pull request #348 from Zyell/dev
Initial Thermostat Range Support
2015-09-12 08:07:52 -07:00
zyell de89de890f Move state constants to __init__ for all thermostats 2015-09-12 07:27:05 -07:00
Paulus Schoutsen 5338b29edf Merge pull request #351 from maddox/itunes
Add iTunes media component
2015-09-11 21:53:03 -07:00
Jon Maddox 395dbe8804 drop the try 2015-09-12 00:50:40 -04:00
Jon Maddox f41786d893 STYLE!!!! 2015-09-12 00:49:34 -04:00
Jon Maddox 34dee0c134 style and docs 2015-09-12 00:42:11 -04:00
Jon Maddox 705238eb78 dat slash 2015-09-12 00:23:12 -04:00
Jon Maddox 2b6e0da405 add docstring 2015-09-12 00:23:04 -04:00
Jon Maddox 9d750368ff moar style fixes 2015-09-12 00:16:51 -04:00
Paulus Schoutsen 7252861b83 Merge pull request #350 from rhooper/sonos
rudimentary sonos support
2015-09-11 21:00:53 -07:00
Roy Hooper db2140782f follow proper calling convention for track_utc_time_change callback 2015-09-11 23:57:34 -04:00
Jon Maddox b9f5ec9e2c style fixes 2015-09-11 23:49:43 -04:00
Jon Maddox 6d9b618f1c add mention of iTunes to README 2015-09-11 23:06:48 -04:00
Jon Maddox a459368998 add itunes.py to .coveragerc 2015-09-11 23:06:17 -04:00
Jon Maddox cb3f14a862 add iTunes component 2015-09-11 23:06:03 -04:00
Roy Hooper e9367d5369 use own track_utc_time_change to poll every 5 seconds 2015-09-11 22:44:37 -04:00
Roy Hooper c3dd94ba04 remove unnecessary self.update_ha_state calls 2015-09-11 22:43:55 -04:00
Paulus Schoutsen 6624cfefd6 Update kodi error reporting 2015-09-11 18:03:02 -07:00
Roy Hooper 350ed9f764 remove and disable pylint: disable=abstract-method for play_youtube() 2015-09-11 19:48:34 -04:00
Roy Hooper 3679a8078a put back play_youtube override 2015-09-11 19:44:18 -04:00
Roy Hooper a25f7eed2b Enable polling and fix metadata updating.
Remove unnecessary methods.
Include SoCo in requirements_all.txt for CI.
Lock down SoCo version to 0.11.1
Add sonos.py to exclusions in .coveragerc
2015-09-11 19:38:42 -04:00
Roy Hooper ae058b7847 tidy up formatting to make travis happy. 2015-09-11 18:55:23 -04:00
Roy Hooper aa74c4e57a fix initialization 2015-09-11 18:52:31 -04:00
Roy Hooper 1b874c603b rudimentary sonos support 2015-09-11 18:44:42 -04:00
Paulus Schoutsen 050fe809e1 Merge pull request #343 from fabaff/arest-switch
aREST switch
2015-09-10 23:53:43 -07:00
Fabian Affolter e2b02f2fd2 Update error message 2015-09-11 08:07:16 +02:00
zyell 775d3198ae Fix logic coverage in target_temperature 2015-09-10 17:46:59 -07:00
zyell 21812ba717 Bug fixes and state adjustment for initial thermostat range support 2015-09-10 15:42:34 -07:00
zyell 2d54fdd979 Initial code for generic thermostat range support and nest compliance 2015-09-10 15:11:59 -07:00
Fabian Affolter e093abc366 Add arest switch 2015-09-10 21:26:51 +02:00
Fabian Affolter 5d3e929599 Add timeout 2015-09-10 21:23:33 +02:00
Fabian Affolter 1ec392a494 Add update 2015-09-10 21:23:33 +02:00
Fabian Affolter d719dd72fe Add arest switch 2015-09-10 21:23:33 +02:00
Fabian Affolter 53b43dc4db Add timeout for requests 2015-09-10 21:21:14 +02:00
Fabian Affolter f21d97d5a2 Add timeout for requests 2015-09-10 21:21:14 +02:00
Paulus Schoutsen f9b17ab026 Device tracker rewrite 2015-09-09 23:37:15 -07:00
Paulus Schoutsen e88fabbe6d Set development version number 2015-09-09 19:38:28 -07:00
Paulus Schoutsen 0509b478e9 Bump version 0.7.2 2015-09-09 19:37:44 -07:00
Malte Deiseroth 0ed608abff little bug 2015-04-07 21:10:16 +02:00
Malte Deiseroth afcf3eaac3 - add ds18S20 1-Wire sensor support
- gitignore emacs backup files
2015-03-29 14:48:17 +02:00
448 changed files with 40464 additions and 11639 deletions
+80 -9
View File
@@ -5,9 +5,21 @@ omit =
homeassistant/__main__.py
# omit pieces of code that rely on external devices being present
homeassistant/components/alarm_control_panel/alarmdotcom.py
homeassistant/components/alarm_control_panel/nx584.py
homeassistant/components/arduino.py
homeassistant/components/*/arduino.py
homeassistant/components/apcupsd.py
homeassistant/components/*/apcupsd.py
homeassistant/components/bloomsky.py
homeassistant/components/*/bloomsky.py
homeassistant/components/insteon_hub.py
homeassistant/components/*/insteon_hub.py
homeassistant/components/isy994.py
homeassistant/components/*/isy994.py
@@ -15,72 +27,131 @@ omit =
homeassistant/components/*/modbus.py
homeassistant/components/*/tellstick.py
homeassistant/components/tellduslive.py
homeassistant/components/*/tellduslive.py
homeassistant/components/*/vera.py
homeassistant/components/ecobee.py
homeassistant/components/*/ecobee.py
homeassistant/components/verisure.py
homeassistant/components/*/verisure.py
homeassistant/components/wink.py
homeassistant/components/*/wink.py
homeassistant/components/zigbee.py
homeassistant/components/*/zigbee.py
homeassistant/components/zwave.py
homeassistant/components/*/zwave.py
homeassistant/components/ifttt.py
homeassistant/components/rfxtrx.py
homeassistant/components/*/rfxtrx.py
homeassistant/components/mysensors.py
homeassistant/components/*/mysensors.py
homeassistant/components/nest.py
homeassistant/components/*/nest.py
homeassistant/components/rpi_gpio.py
homeassistant/components/*/rpi_gpio.py
homeassistant/components/scsgate.py
homeassistant/components/*/scsgate.py
homeassistant/components/binary_sensor/arest.py
homeassistant/components/binary_sensor/rest.py
homeassistant/components/browser.py
homeassistant/components/camera/*
homeassistant/components/device_tracker/actiontec.py
homeassistant/components/device_tracker/aruba.py
homeassistant/components/device_tracker/asuswrt.py
homeassistant/components/device_tracker/ddwrt.py
homeassistant/components/device_tracker/fritz.py
homeassistant/components/device_tracker/icloud.py
homeassistant/components/device_tracker/luci.py
homeassistant/components/device_tracker/netgear.py
homeassistant/components/device_tracker/nmap_tracker.py
homeassistant/components/device_tracker/snmp.py
homeassistant/components/device_tracker/thomson.py
homeassistant/components/device_tracker/tomato.py
homeassistant/components/device_tracker/tplink.py
homeassistant/components/device_tracker/ubus.py
homeassistant/components/discovery.py
homeassistant/components/downloader.py
homeassistant/components/garage_door/wink.py
homeassistant/components/ifttt.py
homeassistant/components/keyboard.py
homeassistant/components/light/blinksticklight.py
homeassistant/components/light/hue.py
homeassistant/components/light/hyperion.py
homeassistant/components/light/lifx.py
homeassistant/components/light/limitlessled.py
homeassistant/components/media_player/cast.py
homeassistant/components/media_player/denon.py
homeassistant/components/media_player/firetv.py
homeassistant/components/media_player/itunes.py
homeassistant/components/media_player/kodi.py
homeassistant/components/media_player/mpd.py
homeassistant/components/media_player/plex.py
homeassistant/components/media_player/samsungtv.py
homeassistant/components/media_player/snapcast.py
homeassistant/components/media_player/sonos.py
homeassistant/components/media_player/squeezebox.py
homeassistant/components/notify/file.py
homeassistant/components/notify/free_mobile.py
homeassistant/components/notify/googlevoice.py
homeassistant/components/notify/instapush.py
homeassistant/components/notify/nma.py
homeassistant/components/notify/pushbullet.py
homeassistant/components/notify/pushetta.py
homeassistant/components/notify/pushover.py
homeassistant/components/notify/rest.py
homeassistant/components/notify/slack.py
homeassistant/components/notify/smtp.py
homeassistant/components/notify/syslog.py
homeassistant/components/notify/telegram.py
homeassistant/components/notify/twitter.py
homeassistant/components/notify/xmpp.py
homeassistant/components/sensor/arest.py
homeassistant/components/sensor/bitcoin.py
homeassistant/components/sensor/cpuspeed.py
homeassistant/components/sensor/dht.py
homeassistant/components/sensor/dweet.py
homeassistant/components/sensor/efergy.py
homeassistant/components/sensor/eliqonline.py
homeassistant/components/sensor/forecast.py
homeassistant/components/sensor/mysensors.py
homeassistant/components/sensor/glances.py
homeassistant/components/sensor/netatmo.py
homeassistant/components/sensor/onewire.py
homeassistant/components/sensor/openweathermap.py
homeassistant/components/sensor/rfxtrx.py
homeassistant/components/sensor/rpi_gpio.py
homeassistant/components/sensor/rest.py
homeassistant/components/sensor/sabnzbd.py
homeassistant/components/sensor/speedtest.py
homeassistant/components/sensor/swiss_public_transport.py
homeassistant/components/sensor/systemmonitor.py
homeassistant/components/sensor/temper.py
homeassistant/components/sensor/time_date.py
homeassistant/components/sensor/torque.py
homeassistant/components/sensor/transmission.py
homeassistant/components/switch/command_switch.py
homeassistant/components/sensor/twitch.py
homeassistant/components/sensor/worldclock.py
homeassistant/components/switch/arest.py
homeassistant/components/switch/edimax.py
homeassistant/components/switch/hikvisioncam.py
homeassistant/components/switch/rpi_gpio.py
homeassistant/components/switch/mystrom.py
homeassistant/components/switch/orvibo.py
homeassistant/components/switch/rest.py
homeassistant/components/switch/transmission.py
homeassistant/components/switch/wemo.py
homeassistant/components/thermostat/nest.py
homeassistant/components/thermostat/heatmiser.py
homeassistant/components/thermostat/homematic.py
homeassistant/components/thermostat/honeywell.py
homeassistant/components/thermostat/proliphix.py
homeassistant/components/thermostat/radiotherm.py
[report]
# Regexes for lines to exclude from consideration
+14 -4
View File
@@ -15,10 +15,6 @@ tests/config/home-assistant.log
*.sublime-project
*.sublime-workspace
# Hide code validator output
pep8.txt
pylint.txt
# Hide some OS X stuff
.DS_Store
.AppleDouble
@@ -30,6 +26,9 @@ Icon
.idea
# pytest
.cache
# GITHUB Proposed Python stuff:
*.py[cod]
@@ -42,6 +41,7 @@ Icon
dist
build
eggs
.eggs
parts
bin
var
@@ -69,6 +69,16 @@ nosetests.xml
.python-version
# emacs auto backups
*~
*#
*.orig
# venv stuff
pyvenv.cfg
pip-selfcheck.json
venv
# vimmy stuff
*.swp
*.swo
+10 -8
View File
@@ -1,13 +1,15 @@
sudo: false
language: python
cache:
directories:
- $HOME/.cache/pip
# - "$HOME/virtualenv/python$TRAVIS_PYTHON_VERSION"
python:
- "3.4"
- 3.4
- 3.5
install:
- pip install -r requirements_all.txt
- pip install flake8 pylint coveralls
- "true"
script:
- flake8 homeassistant
- pylint homeassistant
- coverage run -m unittest discover tests
after_success:
- coveralls
- script/cibuild
matrix:
fast_finish: true
+7 -8
View File
@@ -17,19 +17,18 @@ For help on building your component, please see the [developer documentation](ht
After you finish adding support for your device:
- Update the supported devices in the `README.md` file.
- Add any new dependencies to `requirements.txt`.
- Update the `.coveragerc` file.
- Provide some documentation for [home-assistant.io](https://home-assistant.io/). The documentation is handled in a separate [git repository](https://github.com/balloob/home-assistant.io).
- Make sure all your code passes Pylint and flake8 (PEP8 and some more) validation. To generate reports, run `pylint homeassistant > pylint.txt` and `flake8 homeassistant --exclude bower_components,external > flake8.txt`.
- Add any new dependencies to `requirements_all.txt` if needed. Use `script/gen_requirements_all.py`.
- Update the `.coveragerc` file to exclude your platform if there are no tests available.
- Provide some documentation for [home-assistant.io](https://home-assistant.io/). It's OK to just add a docstring with configuration details (sample entry for `configuration.yaml` file and alike) to the file header as a start. Visit the [website documentation](https://home-assistant.io/developers/website/) for further information on contributing to [home-assistant.io](https://github.com/balloob/home-assistant.io).
- Make sure all your code passes ``pylint`` and ``flake8`` (PEP8 and some more) validation. To check your repository, run `./script/lint`.
- Create a Pull Request against the [**dev**](https://github.com/balloob/home-assistant/tree/dev) branch of Home Assistant.
- Check for comments and suggestions on your Pull Request and keep an eye on the [Travis output](https://travis-ci.org/balloob/home-assistant/).
If you've added a component:
If you add a platform for an existing component, there is usually no need for updating the frontend. Only if you've added a new component that should show up in the frontend, there are more steps needed:
- Update the file [`home-assistant-icons.html`](https://github.com/balloob/home-assistant/blob/master/homeassistant/components/frontend/www_static/polymer/resources/home-assistant-icons.html) with an icon for your domain ([pick one from this list](https://www.polymer-project.org/1.0/components/core-elements/demo.html#core-icon)).
- Update the demo component with two states that it provides
- Add your component to home-assistant.conf.example
- Update the demo component with two states that it provides.
- Add your component to `home-assistant.conf.example`.
Since you've updated `home-assistant-icons.html`, you've made changes to the frontend:
+15 -8
View File
@@ -1,20 +1,27 @@
FROM python:3-onbuild
FROM python:3.4
MAINTAINER Paulus Schoutsen <Paulus@PaulusSchoutsen.nl>
VOLUME /config
RUN pip3 install --no-cache-dir -r requirements_all.txt
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# For the nmap tracker
RUN apt-get update && \
apt-get install -y --no-install-recommends nmap net-tools && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Open Z-Wave disabled because broken
#RUN apt-get update && \
# apt-get install -y cython3 libudev-dev && \
# apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
# pip3 install cython && \
# scripts/build_python_openzwave
COPY script/build_python_openzwave script/build_python_openzwave
RUN apt-get update && \
apt-get install -y cython3 libudev-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
pip3 install "cython<0.23" && \
script/build_python_openzwave
COPY requirements_all.txt requirements_all.txt
RUN pip3 install --no-cache-dir -r requirements_all.txt
# Copy source
COPY . .
CMD [ "python", "-m", "homeassistant", "--config", "/config" ]
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2013 Paulus Schoutsen
Copyright (c) 2016 Paulus Schoutsen
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
+5 -1
View File
@@ -1 +1,5 @@
recursive-exclude tests *
include README.rst
include LICENSE
graft homeassistant
prune homeassistant/components/frontend/www_static/home-assistant-polymer
recursive-exclude * *.py[co]
-37
View File
@@ -1,37 +0,0 @@
# Home Assistant [![Build Status](https://travis-ci.org/balloob/home-assistant.svg?branch=master)](https://travis-ci.org/balloob/home-assistant) [![Coverage Status](https://img.shields.io/coveralls/balloob/home-assistant.svg)](https://coveralls.io/r/balloob/home-assistant?branch=master) [![Join the chat at https://gitter.im/balloob/home-assistant](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/balloob/home-assistant?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[demo]: https://home-assistant.io/demo/
Home Assistant is a home automation platform running on Python 3. The goal of Home Assistant is to be able to track and control all devices at home and offer a platform for automating control.
To get started:
```bash
python3 -m pip install homeassistant
hass --open-ui
```
Check out [the website](https://home-assistant.io) for [a demo][demo], installation instructions, tutorials and documentation.
[![screenshot-states](https://raw.github.com/balloob/home-assistant/master/docs/screenshots.png)][demo]
Examples of devices it can interface it:
* Monitoring connected devices to a wireless router: [OpenWrt](https://openwrt.org/), [Tomato](http://www.polarcloud.com/tomato), [Netgear](http://netgear.com), [DD-WRT](http://www.dd-wrt.com/site/index), [TPLink](http://www.tp-link.us/), and [ASUSWRT](http://event.asus.com/2013/nw/ASUSWRT/)
* [Philips Hue](http://meethue.com) lights, [WeMo](http://www.belkin.com/us/Products/home-automation/c/wemo-home-automation/) switches, [Edimax](http://www.edimax.com/) switches, [Efergy](https://efergy.com) energy monitoring, RFXtrx sensors, and [Tellstick](http://www.telldus.se/products/tellstick) devices and sensors
* [Google Chromecasts](http://www.google.com/intl/en/chrome/devices/chromecast), [Music Player Daemon](http://www.musicpd.org/), [Logitech Squeezebox](https://en.wikipedia.org/wiki/Squeezebox_%28network_music_player%29), and [Kodi (XBMC)](http://kodi.tv/)
* Support for [ISY994](https://www.universal-devices.com/residential/isy994i-series/) (Insteon and X10 devices), [Z-Wave](http://www.z-wave.com/), [Nest Thermostats](https://nest.com/), [Arduino](https://www.arduino.cc/), [Raspberry Pi](https://www.raspberrypi.org/), and [Modbus](http://www.modbus.org/)
* Integrate data from the [Bitcoin](https://bitcoin.org) network, meteorological data from [OpenWeatherMap](http://openweathermap.org/) and [Forecast.io](https://forecast.io/), [Transmission](http://www.transmissionbt.com/), or [SABnzbd](http://sabnzbd.org).
* [See full list of supported devices](https://home-assistant.io/components/)
Built home automation on top of your devices:
* Keep a precise history of every change to the state of your house
* Turn on the lights when people get home after sun set
* Turn on lights slowly during sun set to compensate for less light
* Turn off all lights and devices when everybody leaves the house
* Offers a [REST API](https://home-assistant.io/developers/api.html) and can interface with MQTT for easy integration with other projects
* Allow sending notifications using [Instapush](https://instapush.im), [Notify My Android (NMA)](http://www.notifymyandroid.com/), [PushBullet](https://www.pushbullet.com/), [PushOver](https://pushover.net/), [Slack](https://slack.com/), and [Jabber (XMPP)](http://xmpp.org)
The system is built modular so support for other devices or actions can be implemented easily. See also the [section on architecture](https://home-assistant.io/developers/architecture.html) and the [section on creating your own components](https://home-assistant.io/developers/creating_components.html).
If you run into issues while using Home Assistant or during development of a component, check the [Home Assistant help section](https://home-assistant.io/help/) how to reach us.
+98
View File
@@ -0,0 +1,98 @@
Home Assistant |Build Status| |Coverage Status| |Join the chat at https://gitter.im/balloob/home-assistant|
===========================================================================================================
Home Assistant is a home automation platform running on Python 3. The
goal of Home Assistant is to be able to track and control all devices at
home and offer a platform for automating control.
To get started:
.. code:: bash
python3 -m pip install homeassistant
hass --open-ui
Check out `the website <https://home-assistant.io>`__ for `a
demo <https://home-assistant.io/demo/>`__, installation instructions,
tutorials and documentation.
|screenshot-states|
Examples of devices it can interface it:
- Monitoring connected devices to a wireless router:
`OpenWrt <https://openwrt.org/>`__,
`Tomato <http://www.polarcloud.com/tomato>`__,
`Netgear <http://netgear.com>`__,
`DD-WRT <http://www.dd-wrt.com/site/index>`__,
`TPLink <http://www.tp-link.us/>`__,
`ASUSWRT <http://event.asus.com/2013/nw/ASUSWRT/>`__ and any SNMP
capable Linksys WAP/WRT
- `Philips Hue <http://meethue.com>`__ lights,
`WeMo <http://www.belkin.com/us/Products/home-automation/c/wemo-home-automation/>`__
switches, `Edimax <http://www.edimax.com/>`__ switches,
`Efergy <https://efergy.com>`__ energy monitoring, and
`Tellstick <http://www.telldus.se/products/tellstick>`__ devices and
sensors
- `Google
Chromecasts <http://www.google.com/intl/en/chrome/devices/chromecast>`__,
`Music Player Daemon <http://www.musicpd.org/>`__, `Logitech
Squeezebox <https://en.wikipedia.org/wiki/Squeezebox_%28network_music_player%29>`__,
`Plex <https://plex.tv/>`__, `Kodi (XBMC) <http://kodi.tv/>`__,
iTunes (by way of
`itunes-api <https://github.com/maddox/itunes-api>`__), and Amazon
Fire TV (by way of
`python-firetv <https://github.com/happyleavesaoc/python-firetv>`__)
- Support for
`ISY994 <https://www.universal-devices.com/residential/isy994i-series/>`__
(Insteon and X10 devices), `Z-Wave <http://www.z-wave.com/>`__, `Nest
Thermostats <https://nest.com/>`__,
`RFXtrx <http://www.rfxcom.com/>`__,
`Arduino <https://www.arduino.cc/>`__, `Raspberry
Pi <https://www.raspberrypi.org/>`__, and
`Modbus <http://www.modbus.org/>`__
- Interaction with `IFTTT <https://ifttt.com/>`__
- Integrate data from the `Bitcoin <https://bitcoin.org>`__ network,
meteorological data from
`OpenWeatherMap <http://openweathermap.org/>`__ and
`Forecast.io <https://forecast.io/>`__,
`Transmission <http://www.transmissionbt.com/>`__, or
`SABnzbd <http://sabnzbd.org>`__.
- `See full list of supported
devices <https://home-assistant.io/components/>`__
Built home automation on top of your devices:
- Keep a precise history of every change to the state of your house
- Turn on the lights when people get home after sun set
- Turn on lights slowly during sun set to compensate for less light
- Turn off all lights and devices when everybody leaves the house
- Offers a `REST API <https://home-assistant.io/developers/api/>`__
and can interface with MQTT for easy integration with other projects
like `OwnTracks <http://owntracks.org/>`__
- Allow sending notifications using
`Instapush <https://instapush.im>`__, `Notify My Android
(NMA) <http://www.notifymyandroid.com/>`__,
`PushBullet <https://www.pushbullet.com/>`__,
`PushOver <https://pushover.net/>`__, `Slack <https://slack.com/>`__,
`Telegram <https://telegram.org/>`__, and `Jabber
(XMPP) <http://xmpp.org>`__
The system is built modular so support for other devices or actions can
be implemented easily. See also the `section on
architecture <https://home-assistant.io/developers/architecture.html>`__
and the `section on creating your own
components <https://home-assistant.io/developers/creating_components.html>`__.
If you run into issues while using Home Assistant or during development
of a component, check the `Home Assistant help
section <https://home-assistant.io/help/>`__ how to reach us.
.. |Build Status| image:: https://travis-ci.org/balloob/home-assistant.svg?branch=master
:target: https://travis-ci.org/balloob/home-assistant
.. |Coverage Status| image:: https://img.shields.io/coveralls/balloob/home-assistant.svg
:target: https://coveralls.io/r/balloob/home-assistant?branch=master
.. |Join the chat at https://gitter.im/balloob/home-assistant| image:: https://badges.gitter.im/Join%20Chat.svg
:target: https://gitter.im/balloob/home-assistant?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
.. |screenshot-states| image:: https://raw.github.com/balloob/home-assistant/master/docs/screenshots.png
:target: https://home-assistant.io/demo/
+56 -19
View File
@@ -1,7 +1,9 @@
homeassistant:
# Omitted values in this section will be auto detected using freegeoip.net
# Location required to calculate the time the sun rises and sets
# Location required to calculate the time the sun rises and sets.
# Cooridinates are also used for location for weather related components.
# Google Maps can be used to determine more precise GPS cooridinates.
latitude: 32.87336
longitude: 117.22743
@@ -68,11 +70,18 @@ device_sun_light_trigger:
# A comma separated list of states that have to be tracked as a single group
# Grouped states should share the same type of states (ON/OFF or HOME/NOT_HOME)
# You can also have groups within groups.
group:
Home:
- group.living_room
- group.kitchen
living_room:
- light.Bowl
- light.Ceiling
- light.TV_back_light
kitchen:
- light.fan_bulb_1
- light.fan_bulb_2
children:
- device_tracker.child_1
- device_tracker.child_2
@@ -94,28 +103,39 @@ browser:
keyboard:
automation:
platform: state
alias: Sun starts shining
- alias: 'Rule 1 Light on in the evening'
trigger:
- platform: sun
event: sunset
offset: "-01:00:00"
- platform: state
entity_id: group.all_devices
state: home
condition:
- platform: state
entity_id: group.all_devices
state: home
- platform: time
after: "16:00:00"
before: "23:00:00"
action:
service: homeassistant.turn_on
entity_id: group.living_room
state_entity_id: sun.sun
# Next two are optional, omit to match all
state_from: below_horizon
state_to: above_horizon
- alias: 'Rule 2 - Away Mode'
execute_service: light.turn_off
service_entity_id: group.living_room
trigger:
- platform: state
entity_id: group.all_devices
state: 'not_home'
automation 2:
platform: time
alias: Beer o Clock
condition: use_trigger_values
action:
service: light.turn_off
entity_id: group.all_lights
time_hours: 16
time_minutes: 0
time_seconds: 0
execute_service: notify.notify
service_data:
message: It's 4, time for beer!
# Sensors need to be added into the configuration.yaml as sensor:, sensor 2:, sensor 3:, etc.
# Each sensor label should be unique or your sensors might not load correctly.
sensor:
platform: systemmonitor
@@ -135,6 +155,23 @@ sensor:
- type: 'process'
arg: 'octave-cli'
sensor 2:
platform: forecast
api_key: <register on Forecast.io for your PRIVATE API>
monitored_conditions:
- summary
- precip_type
- precip_intensity
- temperature
- dew_point
- wind_speed
- wind_bearing
- cloud_cover
- humidity
- pressure
- visibility
- ozone
script:
# Turns on the bedroom lights and then the living room lights 1 minute later
wakeup:
+84 -72
View File
@@ -29,9 +29,13 @@ import time
import logging
from homeassistant.const import STATE_HOME, STATE_NOT_HOME, STATE_ON, STATE_OFF
import homeassistant.loader as loader
from homeassistant.helpers import validate_config
from homeassistant.helpers.event_decorators import \
track_state_change, track_time_change
from homeassistant.helpers.service import service
import homeassistant.components as core
from homeassistant.components import device_tracker
from homeassistant.components import light
# The domain of your component. Should be equal to the name of your component
DOMAIN = "example"
@@ -39,11 +43,14 @@ DOMAIN = "example"
# List of component names (string) your component depends upon
# We depend on group because group will be loaded after all the components that
# initialize devices have been setup.
DEPENDENCIES = ['group']
DEPENDENCIES = ['group', 'device_tracker', 'light']
# Configuration key for the entity id we are targetting
CONF_TARGET = 'target'
# Variable for storing configuration parameters
TARGET_ID = None
# Name of the service that we expose
SERVICE_FLASH = 'flash'
@@ -53,84 +60,89 @@ _LOGGER = logging.getLogger(__name__)
def setup(hass, config):
""" Setup example component. """
global TARGET_ID
# Validate that all required config options are given
if not validate_config(config, {DOMAIN: [CONF_TARGET]}, _LOGGER):
return False
target_id = config[DOMAIN][CONF_TARGET]
TARGET_ID = config[DOMAIN][CONF_TARGET]
# Validate that the target entity id exists
if hass.states.get(target_id) is None:
_LOGGER.error("Target entity id %s does not exist", target_id)
if hass.states.get(TARGET_ID) is None:
_LOGGER.error("Target entity id %s does not exist",
TARGET_ID)
# Tell the bootstrapper that we failed to initialize
# Tell the bootstrapper that we failed to initialize and clear the
# stored target id so our functions don't run.
TARGET_ID = None
return False
# We will use the component helper methods to check the states.
device_tracker = loader.get_component('device_tracker')
light = loader.get_component('light')
def track_devices(entity_id, old_state, new_state):
""" Called when the group.all devices change state. """
# If anyone comes home and the core is not on, turn it on.
if new_state.state == STATE_HOME and not core.is_on(hass, target_id):
core.turn_on(hass, target_id)
# If all people leave the house and the core is on, turn it off
elif new_state.state == STATE_NOT_HOME and core.is_on(hass, target_id):
core.turn_off(hass, target_id)
# Register our track_devices method to receive state changes of the
# all tracked devices group.
hass.states.track_change(
device_tracker.ENTITY_ID_ALL_DEVICES, track_devices)
def wake_up(now):
""" Turn it on in the morning if there are people home and
it is not already on. """
if device_tracker.is_on(hass) and not core.is_on(hass, target_id):
_LOGGER.info('People home at 7AM, turning it on')
core.turn_on(hass, target_id)
# Register our wake_up service to be called at 7AM in the morning
hass.track_time_change(wake_up, hour=7, minute=0, second=0)
def all_lights_off(entity_id, old_state, new_state):
""" If all lights turn off, turn off. """
if core.is_on(hass, target_id):
_LOGGER.info('All lights have been turned off, turning it off')
core.turn_off(hass, target_id)
# Register our all_lights_off method to be called when all lights turn off
hass.states.track_change(
light.ENTITY_ID_ALL_LIGHTS, all_lights_off, STATE_ON, STATE_OFF)
def flash_service(call):
""" Service that will turn the target off for 10 seconds
if on and vice versa. """
if core.is_on(hass, target_id):
core.turn_off(hass, target_id)
time.sleep(10)
core.turn_on(hass, target_id)
else:
core.turn_on(hass, target_id)
time.sleep(10)
core.turn_off(hass, target_id)
# Register our service with HASS.
hass.services.register(DOMAIN, SERVICE_FLASH, flash_service)
# Tells the bootstrapper that the component was successfully initialized
# Tell the bootstrapper that we initialized successfully
return True
@track_state_change(device_tracker.ENTITY_ID_ALL_DEVICES)
def track_devices(hass, entity_id, old_state, new_state):
""" Called when the group.all devices change state. """
# If the target id is not set, return
if not TARGET_ID:
return
# If anyone comes home and the entity is not on, turn it on.
if new_state.state == STATE_HOME and not core.is_on(hass, TARGET_ID):
core.turn_on(hass, TARGET_ID)
# If all people leave the house and the entity is on, turn it off
elif new_state.state == STATE_NOT_HOME and core.is_on(hass, TARGET_ID):
core.turn_off(hass, TARGET_ID)
@track_time_change(hour=7, minute=0, second=0)
def wake_up(hass, now):
"""
Turn it on in the morning (7 AM) if there are people home and
it is not already on.
"""
if not TARGET_ID:
return
if device_tracker.is_on(hass) and not core.is_on(hass, TARGET_ID):
_LOGGER.info('People home at 7AM, turning it on')
core.turn_on(hass, TARGET_ID)
@track_state_change(light.ENTITY_ID_ALL_LIGHTS, STATE_ON, STATE_OFF)
def all_lights_off(hass, entity_id, old_state, new_state):
""" If all lights turn off, turn off. """
if not TARGET_ID:
return
if core.is_on(hass, TARGET_ID):
_LOGGER.info('All lights have been turned off, turning it off')
core.turn_off(hass, TARGET_ID)
@service(DOMAIN, SERVICE_FLASH)
def flash_service(hass, call):
"""
Service that will turn the target off for 10 seconds if on and vice versa.
"""
if not TARGET_ID:
return
if core.is_on(hass, TARGET_ID):
core.turn_off(hass, TARGET_ID)
time.sleep(10)
core.turn_on(hass, TARGET_ID)
else:
core.turn_on(hass, TARGET_ID)
time.sleep(10)
core.turn_off(hass, TARGET_ID)
+150 -16
View File
@@ -1,13 +1,18 @@
""" Starts home assistant. """
from __future__ import print_function
from multiprocessing import Process
import signal
import sys
import threading
import os
import argparse
import time
from homeassistant import bootstrap
import homeassistant.config as config_util
from homeassistant.const import __version__, EVENT_HOMEASSISTANT_START
from homeassistant.const import (__version__, EVENT_HOMEASSISTANT_START,
RESTART_EXIT_CODE)
def validate_python():
@@ -73,6 +78,11 @@ def get_arguments():
'--demo-mode',
action='store_true',
help='Start Home Assistant in demo mode')
parser.add_argument(
'--debug',
action='store_true',
help='Start Home Assistant in debug mode. Runs in single process to '
'enable use of interactive debuggers.')
parser.add_argument(
'--open-ui',
action='store_true',
@@ -95,6 +105,18 @@ def get_arguments():
type=int,
default=None,
help='Enables daily log rotation and keeps up to the specified days')
parser.add_argument(
'--install-osx',
action='store_true',
help='Installs as a service on OS X and loads on boot.')
parser.add_argument(
'--uninstall-osx',
action='store_true',
help='Uninstalls from OS X.')
parser.add_argument(
'--restart-osx',
action='store_true',
help='Restarts on OS X.')
if os.name != "nt":
parser.add_argument(
'--daemon',
@@ -152,23 +174,51 @@ def write_pid(pid_file):
sys.exit(1)
def main():
""" Starts Home Assistant. """
validate_python()
def install_osx():
""" Setup to run via launchd on OS X """
with os.popen('which hass') as inp:
hass_path = inp.read().strip()
args = get_arguments()
with os.popen('whoami') as inp:
user = inp.read().strip()
config_dir = os.path.join(os.getcwd(), args.config)
ensure_config_path(config_dir)
cwd = os.path.dirname(__file__)
template_path = os.path.join(cwd, 'startup', 'launchd.plist')
# daemon functions
if args.pid_file:
check_pid(args.pid_file)
if args.daemon:
daemonize()
if args.pid_file:
write_pid(args.pid_file)
with open(template_path, 'r', encoding='utf-8') as inp:
plist = inp.read()
plist = plist.replace("$HASS_PATH$", hass_path)
plist = plist.replace("$USER$", user)
path = os.path.expanduser("~/Library/LaunchAgents/org.homeassistant.plist")
try:
with open(path, 'w', encoding='utf-8') as outp:
outp.write(plist)
except IOError as err:
print('Unable to write to ' + path, err)
return
os.popen('launchctl load -w -F ' + path)
print("Home Assistant has been installed. \
Open it here: http://localhost:8123")
def uninstall_osx():
""" Unload from launchd on OS X """
path = os.path.expanduser("~/Library/LaunchAgents/org.homeassistant.plist")
os.popen('launchctl unload ' + path)
print("Home Assistant has been uninstalled.")
def setup_and_run_hass(config_dir, args, top_process=False):
"""
Setup HASS and run. Block until stopped. Will assume it is running in a
subprocess unless top_process is set to true.
"""
if args.demo_mode:
config = {
'frontend': {},
@@ -195,7 +245,91 @@ def main():
hass.bus.listen_once(EVENT_HOMEASSISTANT_START, open_browser)
hass.start()
hass.block_till_stopped()
exit_code = int(hass.block_till_stopped())
if not top_process:
sys.exit(exit_code)
return exit_code
def run_hass_process(hass_proc):
""" Runs a child hass process. Returns True if it should be restarted. """
requested_stop = threading.Event()
hass_proc.daemon = True
def request_stop(*args):
""" request hass stop, *args is for signal handler callback """
requested_stop.set()
hass_proc.terminate()
try:
signal.signal(signal.SIGTERM, request_stop)
except ValueError:
print('Could not bind to SIGTERM. Are you running in a thread?')
hass_proc.start()
try:
hass_proc.join()
except KeyboardInterrupt:
request_stop()
try:
hass_proc.join()
except KeyboardInterrupt:
return False
return (not requested_stop.isSet() and
hass_proc.exitcode == RESTART_EXIT_CODE,
hass_proc.exitcode)
def main():
""" Starts Home Assistant. """
validate_python()
args = get_arguments()
config_dir = os.path.join(os.getcwd(), args.config)
ensure_config_path(config_dir)
# os x launchd functions
if args.install_osx:
install_osx()
return 0
if args.uninstall_osx:
uninstall_osx()
return 0
if args.restart_osx:
uninstall_osx()
# A small delay is needed on some systems to let the unload finish.
time.sleep(0.5)
install_osx()
return 0
# daemon functions
if args.pid_file:
check_pid(args.pid_file)
if args.daemon:
daemonize()
if args.pid_file:
write_pid(args.pid_file)
# Run hass in debug mode if requested
if args.debug:
sys.stderr.write('Running in debug mode. '
'Home Assistant will not be able to restart.\n')
exit_code = setup_and_run_hass(config_dir, args, top_process=True)
if exit_code == RESTART_EXIT_CODE:
sys.stderr.write('Home Assistant requested a '
'restart in debug mode.\n')
return exit_code
# Run hass as child process. Restart if necessary.
keep_running = True
while keep_running:
hass_proc = Process(target=setup_and_run_hass, args=(config_dir, args))
keep_running, exit_code = run_hass_process(hass_proc)
return exit_code
if __name__ == "__main__":
main()
sys.exit(main())
+60 -23
View File
@@ -9,11 +9,12 @@ After bootstrapping you can add your own components or
start by calling homeassistant.start_home_assistant(bus)
"""
import os
import sys
from collections import defaultdict
import logging
import logging.handlers
from collections import defaultdict
import os
import shutil
import sys
import homeassistant.core as core
import homeassistant.util.dt as date_util
@@ -23,9 +24,10 @@ import homeassistant.config as config_util
import homeassistant.loader as loader
import homeassistant.components as core_components
import homeassistant.components.group as group
from homeassistant.helpers import event_decorators, service
from homeassistant.helpers.entity import Entity
from homeassistant.const import (
EVENT_COMPONENT_LOADED, CONF_LATITUDE, CONF_LONGITUDE,
__version__, EVENT_COMPONENT_LOADED, CONF_LATITUDE, CONF_LONGITUDE,
CONF_TEMPERATURE_UNIT, CONF_NAME, CONF_TIME_ZONE, CONF_CUSTOMIZE,
TEMP_CELCIUS, TEMP_FAHRENHEIT)
@@ -34,6 +36,7 @@ _LOGGER = logging.getLogger(__name__)
ATTR_COMPONENT = 'component'
PLATFORM_FORMAT = '{}.{}'
ERROR_LOG_FILENAME = 'home-assistant.log'
def setup_component(hass, domain, config=None):
@@ -80,7 +83,7 @@ def _setup_component(hass, domain, config):
return True
component = loader.get_component(domain)
missing_deps = [dep for dep in component.DEPENDENCIES
missing_deps = [dep for dep in getattr(component, 'DEPENDENCIES', [])
if dep not in hass.config.components]
if missing_deps:
@@ -104,7 +107,7 @@ def _setup_component(hass, domain, config):
# Assumption: if a component does not depend on groups
# it communicates with devices
if group.DOMAIN not in component.DEPENDENCIES:
if group.DOMAIN not in getattr(component, 'DEPENDENCIES', []):
hass.pool.add_worker()
hass.bus.fire(
@@ -123,6 +126,7 @@ def prepare_setup_platform(hass, config, domain, platform_name):
# Not found
if platform is None:
_LOGGER.error('Unable to find platform %s', platform_path)
return None
# Already loaded
@@ -130,14 +134,13 @@ def prepare_setup_platform(hass, config, domain, platform_name):
return platform
# Load dependencies
if hasattr(platform, 'DEPENDENCIES'):
for component in platform.DEPENDENCIES:
if not setup_component(hass, component, config):
_LOGGER.error(
'Unable to prepare setup for platform %s because '
'dependency %s could not be initialized', platform_path,
component)
return None
for component in getattr(platform, 'DEPENDENCIES', []):
if not setup_component(hass, component, config):
_LOGGER.error(
'Unable to prepare setup for platform %s because '
'dependency %s could not be initialized', platform_path,
component)
return None
if not _handle_requirements(hass, platform, platform_path):
return None
@@ -166,6 +169,7 @@ def from_config_dict(config, hass=None, config_dir=None, enable_log=True,
hass.config.config_dir = config_dir
mount_local_lib_path(config_dir)
process_ha_config_upgrade(hass)
process_ha_core_config(hass, config.get(core.DOMAIN, {}))
if enable_log:
@@ -185,8 +189,8 @@ def from_config_dict(config, hass=None, config_dir=None, enable_log=True,
dict, {key: value or {} for key, value in config.items()})
# Filter out the repeating and common config section [homeassistant]
components = (key for key in config.keys()
if ' ' not in key and key != core.DOMAIN)
components = set(key.split(' ')[0] for key in config.keys()
if key != core.DOMAIN)
if not core_components.setup(hass, config):
_LOGGER.error('Home Assistant core failed to initialize. '
@@ -196,6 +200,10 @@ def from_config_dict(config, hass=None, config_dir=None, enable_log=True,
_LOGGER.info('Home Assistant core initialized')
# give event decorators access to HASS
event_decorators.HASS = hass
service.HASS = hass
# Setup the components
for domain in loader.load_order_components(components):
_setup_component(hass, domain, config)
@@ -220,7 +228,7 @@ def from_config_file(config_path, hass=None, verbose=False, daemon=False,
enable_logging(hass, verbose, daemon, log_rotate_days)
config_dict = config_util.load_config_file(config_path)
config_dict = config_util.load_yaml_config_file(config_path)
return from_config_dict(config_dict, hass, enable_log=False,
skip_pip=skip_pip)
@@ -251,7 +259,7 @@ def enable_logging(hass, verbose=False, daemon=False, log_rotate_days=None):
"Colorlog package not found, console coloring disabled")
# Log errors to a file if we have write access to file or config dir
err_log_path = hass.config.path('home-assistant.log')
err_log_path = hass.config.path(ERROR_LOG_FILENAME)
err_path_exists = os.path.isfile(err_log_path)
# Check if we can write to the error log if it exists or that
@@ -272,13 +280,38 @@ def enable_logging(hass, verbose=False, daemon=False, log_rotate_days=None):
datefmt='%y-%m-%d %H:%M:%S'))
logger = logging.getLogger('')
logger.addHandler(err_handler)
logger.setLevel(logging.INFO) # this sets the minimum log level
logger.setLevel(logging.INFO)
else:
_LOGGER.error(
'Unable to setup error log %s (access denied)', err_log_path)
def process_ha_config_upgrade(hass):
""" Upgrade config if necessary. """
version_path = hass.config.path('.HA_VERSION')
try:
with open(version_path, 'rt') as inp:
conf_version = inp.readline().strip()
except FileNotFoundError:
# Last version to not have this file
conf_version = '0.7.7'
if conf_version == __version__:
return
_LOGGER.info('Upgrading config directory from %s to %s', conf_version,
__version__)
lib_path = hass.config.path('lib')
if os.path.isdir(lib_path):
shutil.rmtree(lib_path)
with open(version_path, 'wt') as outp:
outp.write(__version__)
def process_ha_core_config(hass, config):
""" Processes the [homeassistant] section from the config. """
hac = hass.config
@@ -296,11 +329,15 @@ def process_ha_core_config(hass, config):
else:
_LOGGER.error('Received invalid time zone %s', time_zone_str)
for key, attr in ((CONF_LATITUDE, 'latitude'),
(CONF_LONGITUDE, 'longitude'),
(CONF_NAME, 'location_name')):
for key, attr, typ in ((CONF_LATITUDE, 'latitude', float),
(CONF_LONGITUDE, 'longitude', float),
(CONF_NAME, 'location_name', str)):
if key in config:
setattr(hac, attr, config[key])
try:
setattr(hac, attr, typ(config[key]))
except ValueError:
_LOGGER.error('Received invalid %s value for %s: %s',
typ.__name__, key, attr)
set_time_zone(config.get(CONF_TIME_ZONE))
+23 -8
View File
@@ -1,7 +1,6 @@
"""
homeassistant.components
~~~~~~~~~~~~~~~~~~~~~~~~
This package contains components that can be plugged into Home Assistant.
Component design guidelines:
@@ -12,17 +11,16 @@ Each component that tracks states should create state entity names in the
format "<DOMAIN>.<OBJECT_ID>".
Each component should publish services only under its own domain.
"""
import itertools as it
import logging
import homeassistant.core as ha
import homeassistant.util as util
from homeassistant.helpers import extract_entity_ids
from homeassistant.helpers.entity import split_entity_id
from homeassistant.helpers.service import extract_entity_ids
from homeassistant.loader import get_component
from homeassistant.const import (
ATTR_ENTITY_ID, SERVICE_TURN_ON, SERVICE_TURN_OFF)
ATTR_ENTITY_ID, SERVICE_TURN_ON, SERVICE_TURN_OFF, SERVICE_TOGGLE)
_LOGGER = logging.getLogger(__name__)
@@ -38,7 +36,7 @@ def is_on(hass, entity_id=None):
entity_ids = hass.states.entity_ids()
for entity_id in entity_ids:
domain = util.split_entity_id(entity_id)[0]
domain = split_entity_id(entity_id)[0]
module = get_component(domain)
@@ -70,6 +68,14 @@ def turn_off(hass, entity_id=None, **service_data):
hass.services.call(ha.DOMAIN, SERVICE_TURN_OFF, service_data)
def toggle(hass, entity_id=None, **service_data):
""" Toggles specified entity. """
if entity_id is not None:
service_data[ATTR_ENTITY_ID] = entity_id
hass.services.call(ha.DOMAIN, SERVICE_TOGGLE, service_data)
def setup(hass, config):
""" Setup general services related to homeassistant. """
@@ -86,18 +92,27 @@ def setup(hass, config):
# Group entity_ids by domain. groupby requires sorted data.
by_domain = it.groupby(sorted(entity_ids),
lambda item: util.split_entity_id(item)[0])
lambda item: split_entity_id(item)[0])
for domain, ent_ids in by_domain:
# We want to block for all calls and only return when all calls
# have been processed. If a service does not exist it causes a 10
# second delay while we're blocking waiting for a response.
# But services can be registered on other HA instances that are
# listening to the bus too. So as a in between solution, we'll
# block only if the service is defined in the current HA instance.
blocking = hass.services.has_service(domain, service.service)
# Create a new dict for this call
data = dict(service.data)
# ent_ids is a generator, convert it to a list.
data[ATTR_ENTITY_ID] = list(ent_ids)
hass.services.call(domain, service.service, data, True)
hass.services.call(domain, service.service, data, blocking)
hass.services.register(ha.DOMAIN, SERVICE_TURN_OFF, handle_turn_service)
hass.services.register(ha.DOMAIN, SERVICE_TURN_ON, handle_turn_service)
hass.services.register(ha.DOMAIN, SERVICE_TOGGLE, handle_turn_service)
return True
@@ -0,0 +1,152 @@
"""
homeassistant.components.alarm_control_panel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Component to interface with a alarm control panel.
"""
import logging
import os
from homeassistant.components import verisure
from homeassistant.const import (
ATTR_ENTITY_ID, SERVICE_ALARM_TRIGGER,
SERVICE_ALARM_DISARM, SERVICE_ALARM_ARM_HOME, SERVICE_ALARM_ARM_AWAY)
from homeassistant.config import load_yaml_config_file
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent
DOMAIN = 'alarm_control_panel'
SCAN_INTERVAL = 30
ENTITY_ID_FORMAT = DOMAIN + '.{}'
# Maps discovered services to their platforms
DISCOVERY_PLATFORMS = {
verisure.DISCOVER_SENSORS: 'verisure'
}
SERVICE_TO_METHOD = {
SERVICE_ALARM_DISARM: 'alarm_disarm',
SERVICE_ALARM_ARM_HOME: 'alarm_arm_home',
SERVICE_ALARM_ARM_AWAY: 'alarm_arm_away',
SERVICE_ALARM_TRIGGER: 'alarm_trigger'
}
ATTR_CODE = 'code'
ATTR_CODE_FORMAT = 'code_format'
ATTR_TO_PROPERTY = [
ATTR_CODE,
ATTR_CODE_FORMAT
]
def setup(hass, config):
""" Track states and offer events for sensors. """
component = EntityComponent(
logging.getLogger(__name__), DOMAIN, hass, SCAN_INTERVAL,
DISCOVERY_PLATFORMS)
component.setup(config)
def alarm_service_handler(service):
""" Maps services to methods on Alarm. """
target_alarms = component.extract_from_service(service)
if ATTR_CODE not in service.data:
code = None
else:
code = service.data[ATTR_CODE]
method = SERVICE_TO_METHOD[service.service]
for alarm in target_alarms:
getattr(alarm, method)(code)
if alarm.should_poll:
alarm.update_ha_state(True)
descriptions = load_yaml_config_file(
os.path.join(os.path.dirname(__file__), 'services.yaml'))
for service in SERVICE_TO_METHOD:
hass.services.register(DOMAIN, service, alarm_service_handler,
descriptions.get(service))
return True
def alarm_disarm(hass, code=None, entity_id=None):
""" Send the alarm the command for disarm. """
data = {}
if code:
data[ATTR_CODE] = code
if entity_id:
data[ATTR_ENTITY_ID] = entity_id
hass.services.call(DOMAIN, SERVICE_ALARM_DISARM, data)
def alarm_arm_home(hass, code=None, entity_id=None):
""" Send the alarm the command for arm home. """
data = {}
if code:
data[ATTR_CODE] = code
if entity_id:
data[ATTR_ENTITY_ID] = entity_id
hass.services.call(DOMAIN, SERVICE_ALARM_ARM_HOME, data)
def alarm_arm_away(hass, code=None, entity_id=None):
""" Send the alarm the command for arm away. """
data = {}
if code:
data[ATTR_CODE] = code
if entity_id:
data[ATTR_ENTITY_ID] = entity_id
hass.services.call(DOMAIN, SERVICE_ALARM_ARM_AWAY, data)
def alarm_trigger(hass, code=None, entity_id=None):
""" Send the alarm the command for trigger. """
data = {}
if code:
data[ATTR_CODE] = code
if entity_id:
data[ATTR_ENTITY_ID] = entity_id
hass.services.call(DOMAIN, SERVICE_ALARM_TRIGGER, data)
# pylint: disable=no-self-use
class AlarmControlPanel(Entity):
""" ABC for alarm control devices. """
@property
def code_format(self):
""" regex for code format or None if no code is required. """
return None
def alarm_disarm(self, code=None):
""" Send disarm command. """
raise NotImplementedError()
def alarm_arm_home(self, code=None):
""" Send arm home command. """
raise NotImplementedError()
def alarm_arm_away(self, code=None):
""" Send arm away command. """
raise NotImplementedError()
def alarm_trigger(self, code=None):
""" Send alarm trigger command. """
raise NotImplementedError()
@property
def state_attributes(self):
""" Return the state attributes. """
state_attr = {
ATTR_CODE_FORMAT: self.code_format,
}
return state_attr
@@ -0,0 +1,117 @@
"""
homeassistant.components.alarm_control_panel.alarmdotcom
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Interfaces with Verisure alarm control panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.alarmdotcom/
"""
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD
from homeassistant.const import (
STATE_UNKNOWN,
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_AWAY)
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['https://github.com/Xorso/pyalarmdotcom'
'/archive/0.0.7.zip'
'#pyalarmdotcom==0.0.7']
DEFAULT_NAME = 'Alarm.com'
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Setup an Alarm.com control panel. """
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
if username is None or password is None:
_LOGGER.error('Must specify username and password!')
return False
add_devices([AlarmDotCom(hass,
config.get('name', DEFAULT_NAME),
config.get('code'),
username,
password)])
# pylint: disable=too-many-arguments, too-many-instance-attributes
# pylint: disable=abstract-method
class AlarmDotCom(alarm.AlarmControlPanel):
""" Represents a Alarm.com status. """
def __init__(self, hass, name, code, username, password):
from pyalarmdotcom.pyalarmdotcom import Alarmdotcom
self._alarm = Alarmdotcom(username, password, timeout=10)
self._hass = hass
self._name = name
self._code = str(code) if code else None
self._username = username
self._password = password
@property
def should_poll(self):
""" No polling needed. """
return True
@property
def name(self):
""" Returns the name of the device. """
return self._name
@property
def code_format(self):
""" One or more characters if code is defined. """
return None if self._code is None else '.+'
@property
def state(self):
""" Returns the state of the device. """
if self._alarm.state == 'Disarmed':
return STATE_ALARM_DISARMED
elif self._alarm.state == 'Armed Stay':
return STATE_ALARM_ARMED_HOME
elif self._alarm.state == 'Armed Away':
return STATE_ALARM_ARMED_AWAY
else:
return STATE_UNKNOWN
def alarm_disarm(self, code=None):
""" Send disarm command. """
if not self._validate_code(code, 'arming home'):
return
from pyalarmdotcom.pyalarmdotcom import Alarmdotcom
# Open another session to alarm.com to fire off the command
_alarm = Alarmdotcom(self._username, self._password, timeout=10)
_alarm.disarm()
def alarm_arm_home(self, code=None):
""" Send arm home command. """
if not self._validate_code(code, 'arming home'):
return
from pyalarmdotcom.pyalarmdotcom import Alarmdotcom
# Open another session to alarm.com to fire off the command
_alarm = Alarmdotcom(self._username, self._password, timeout=10)
_alarm.arm_stay()
def alarm_arm_away(self, code=None):
""" Send arm away command. """
if not self._validate_code(code, 'arming home'):
return
from pyalarmdotcom.pyalarmdotcom import Alarmdotcom
# Open another session to alarm.com to fire off the command
_alarm = Alarmdotcom(self._username, self._password, timeout=10)
_alarm.arm_away()
def _validate_code(self, code, state):
""" Validate given code. """
check = self._code is None or code == self._code
if not check:
_LOGGER.warning('Wrong code entered for %s', state)
return check
@@ -0,0 +1,13 @@
"""
homeassistant.components.alarm_control_panel.demo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo platform that has two fake alarm control panels.
"""
import homeassistant.components.alarm_control_panel.manual as manual
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the Demo alarm control panels. """
add_devices([
manual.ManualAlarm(hass, 'Alarm', '1234', 5, 10),
])
@@ -0,0 +1,148 @@
"""
homeassistant.components.alarm_control_panel.manual
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for manual alarms.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.manual/
"""
import logging
import datetime
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.helpers.event import track_point_in_time
import homeassistant.util.dt as dt_util
from homeassistant.const import (
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_AWAY,
STATE_ALARM_PENDING, STATE_ALARM_TRIGGERED)
_LOGGER = logging.getLogger(__name__)
DEFAULT_ALARM_NAME = 'HA Alarm'
DEFAULT_PENDING_TIME = 60
DEFAULT_TRIGGER_TIME = 120
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the manual alarm platform. """
add_devices([ManualAlarm(
hass,
config.get('name', DEFAULT_ALARM_NAME),
config.get('code'),
config.get('pending_time', DEFAULT_PENDING_TIME),
config.get('trigger_time', DEFAULT_TRIGGER_TIME),
)])
# pylint: disable=too-many-arguments, too-many-instance-attributes
# pylint: disable=abstract-method
class ManualAlarm(alarm.AlarmControlPanel):
"""
Represents an alarm status.
When armed, will be pending for 'pending_time', after that armed.
When triggered, will be pending for 'trigger_time'. After that will be
triggered for 'trigger_time', after that we return to disarmed.
"""
def __init__(self, hass, name, code, pending_time, trigger_time):
self._state = STATE_ALARM_DISARMED
self._hass = hass
self._name = name
self._code = str(code) if code else None
self._pending_time = datetime.timedelta(seconds=pending_time)
self._trigger_time = datetime.timedelta(seconds=trigger_time)
self._state_ts = None
@property
def should_poll(self):
""" No polling needed. """
return False
@property
def name(self):
""" Returns the name of the device. """
return self._name
@property
def state(self):
""" Returns the state of the device. """
if self._state in (STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_AWAY) and \
self._pending_time and self._state_ts + self._pending_time > \
dt_util.utcnow():
return STATE_ALARM_PENDING
if self._state == STATE_ALARM_TRIGGERED and self._trigger_time:
if self._state_ts + self._pending_time > dt_util.utcnow():
return STATE_ALARM_PENDING
elif (self._state_ts + self._pending_time +
self._trigger_time) < dt_util.utcnow():
return STATE_ALARM_DISARMED
return self._state
@property
def code_format(self):
""" One or more characters. """
return None if self._code is None else '.+'
def alarm_disarm(self, code=None):
""" Send disarm command. """
if not self._validate_code(code, STATE_ALARM_DISARMED):
return
self._state = STATE_ALARM_DISARMED
self._state_ts = dt_util.utcnow()
self.update_ha_state()
def alarm_arm_home(self, code=None):
""" Send arm home command. """
if not self._validate_code(code, STATE_ALARM_ARMED_HOME):
return
self._state = STATE_ALARM_ARMED_HOME
self._state_ts = dt_util.utcnow()
self.update_ha_state()
if self._pending_time:
track_point_in_time(
self._hass, self.update_ha_state,
self._state_ts + self._pending_time)
def alarm_arm_away(self, code=None):
""" Send arm away command. """
if not self._validate_code(code, STATE_ALARM_ARMED_AWAY):
return
self._state = STATE_ALARM_ARMED_AWAY
self._state_ts = dt_util.utcnow()
self.update_ha_state()
if self._pending_time:
track_point_in_time(
self._hass, self.update_ha_state,
self._state_ts + self._pending_time)
def alarm_trigger(self, code=None):
""" Send alarm trigger command. No code needed. """
self._state = STATE_ALARM_TRIGGERED
self._state_ts = dt_util.utcnow()
self.update_ha_state()
if self._trigger_time:
track_point_in_time(
self._hass, self.update_ha_state,
self._state_ts + self._pending_time)
track_point_in_time(
self._hass, self.update_ha_state,
self._state_ts + self._pending_time + self._trigger_time)
def _validate_code(self, code, state):
""" Validate given code. """
check = self._code is None or code == self._code
if not check:
_LOGGER.warning('Invalid code given for %s', state)
return check
@@ -0,0 +1,127 @@
"""
homeassistant.components.alarm_control_panel.mqtt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This platform enables the possibility to control a MQTT alarm.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.mqtt/
"""
import logging
import homeassistant.components.mqtt as mqtt
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_AWAY,
STATE_ALARM_PENDING, STATE_ALARM_TRIGGERED, STATE_UNKNOWN)
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = "MQTT Alarm"
DEFAULT_QOS = 0
DEFAULT_PAYLOAD_DISARM = "DISARM"
DEFAULT_PAYLOAD_ARM_HOME = "ARM_HOME"
DEFAULT_PAYLOAD_ARM_AWAY = "ARM_AWAY"
DEPENDENCIES = ['mqtt']
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the MQTT platform. """
if config.get('state_topic') is None:
_LOGGER.error("Missing required variable: state_topic")
return False
if config.get('command_topic') is None:
_LOGGER.error("Missing required variable: command_topic")
return False
add_devices([MqttAlarm(
hass,
config.get('name', DEFAULT_NAME),
config.get('state_topic'),
config.get('command_topic'),
config.get('qos', DEFAULT_QOS),
config.get('payload_disarm', DEFAULT_PAYLOAD_DISARM),
config.get('payload_arm_home', DEFAULT_PAYLOAD_ARM_HOME),
config.get('payload_arm_away', DEFAULT_PAYLOAD_ARM_AWAY),
config.get('code'))])
# pylint: disable=too-many-arguments, too-many-instance-attributes
# pylint: disable=abstract-method
class MqttAlarm(alarm.AlarmControlPanel):
""" represents a MQTT alarm status within home assistant. """
def __init__(self, hass, name, state_topic, command_topic, qos,
payload_disarm, payload_arm_home, payload_arm_away, code):
self._state = STATE_UNKNOWN
self._hass = hass
self._name = name
self._state_topic = state_topic
self._command_topic = command_topic
self._qos = qos
self._payload_disarm = payload_disarm
self._payload_arm_home = payload_arm_home
self._payload_arm_away = payload_arm_away
self._code = str(code) if code else None
def message_received(topic, payload, qos):
""" A new MQTT message has been received. """
if payload not in (STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_AWAY, STATE_ALARM_PENDING,
STATE_ALARM_TRIGGERED):
_LOGGER.warning('Received unexpected payload: %s', payload)
return
self._state = payload
self.update_ha_state()
mqtt.subscribe(hass, self._state_topic, message_received, self._qos)
@property
def should_poll(self):
""" No polling needed """
return False
@property
def name(self):
""" Returns the name of the device. """
return self._name
@property
def state(self):
""" Returns the state of the device. """
return self._state
@property
def code_format(self):
""" One or more characters if code is defined """
return None if self._code is None else '.+'
def alarm_disarm(self, code=None):
""" Send disarm command. """
if not self._validate_code(code, 'disarming'):
return
mqtt.publish(self.hass, self._command_topic,
self._payload_disarm, self._qos)
def alarm_arm_home(self, code=None):
""" Send arm home command. """
if not self._validate_code(code, 'arming home'):
return
mqtt.publish(self.hass, self._command_topic,
self._payload_arm_home, self._qos)
def alarm_arm_away(self, code=None):
""" Send arm away command. """
if not self._validate_code(code, 'arming away'):
return
mqtt.publish(self.hass, self._command_topic,
self._payload_arm_away, self._qos)
def _validate_code(self, code, state):
""" Validate given code. """
check = self._code is None or code == self._code
if not check:
_LOGGER.warning('Wrong code entered for %s', state)
return check
@@ -0,0 +1,105 @@
"""
homeassistant.components.alarm_control_panel.nx584
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for NX584 alarm control panels.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.nx584/
"""
import logging
import requests
from homeassistant.const import (STATE_UNKNOWN, STATE_ALARM_DISARMED,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_AWAY)
import homeassistant.components.alarm_control_panel as alarm
REQUIREMENTS = ['pynx584==0.1']
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Setup nx584. """
host = config.get('host', 'localhost:5007')
try:
add_devices([NX584Alarm(hass, host, config.get('name', 'NX584'))])
except requests.exceptions.ConnectionError as ex:
_LOGGER.error('Unable to connect to NX584: %s', str(ex))
return False
class NX584Alarm(alarm.AlarmControlPanel):
""" NX584-based alarm panel. """
def __init__(self, hass, host, name):
from nx584 import client
self._hass = hass
self._host = host
self._name = name
self._alarm = client.Client('http://%s' % host)
# Do an initial list operation so that we will try to actually
# talk to the API and trigger a requests exception for setup_platform()
# to catch
self._alarm.list_zones()
@property
def should_poll(self):
""" Polling needed. """
return True
@property
def name(self):
""" Returns the name of the device. """
return self._name
@property
def code_format(self):
""" Characters if code is defined. """
return '[0-9]{4}([0-9]{2})?'
@property
def state(self):
""" Returns the state of the device. """
try:
part = self._alarm.list_partitions()[0]
zones = self._alarm.list_zones()
except requests.exceptions.ConnectionError as ex:
_LOGGER.error('Unable to connect to %(host)s: %(reason)s',
dict(host=self._host, reason=ex))
return STATE_UNKNOWN
except IndexError:
_LOGGER.error('nx584 reports no partitions')
return STATE_UNKNOWN
bypassed = False
for zone in zones:
if zone['bypassed']:
_LOGGER.debug('Zone %(zone)s is bypassed, '
'assuming HOME',
dict(zone=zone['number']))
bypassed = True
break
if not part['armed']:
return STATE_ALARM_DISARMED
elif bypassed:
return STATE_ALARM_ARMED_HOME
else:
return STATE_ALARM_ARMED_AWAY
def alarm_disarm(self, code=None):
""" Send disarm command. """
self._alarm.disarm(code)
def alarm_arm_home(self, code=None):
""" Send arm home command. """
self._alarm.arm('home')
def alarm_arm_away(self, code=None):
""" Send arm away command. """
self._alarm.arm('auto')
def alarm_trigger(self, code=None):
""" Alarm trigger command. """
raise NotImplementedError()
@@ -0,0 +1,96 @@
"""
homeassistant.components.alarm_control_panel.verisure
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Interfaces with Verisure alarm control panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/verisure/
"""
import logging
import homeassistant.components.verisure as verisure
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (
STATE_UNKNOWN,
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_AWAY)
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the Verisure platform. """
if not verisure.MY_PAGES:
_LOGGER.error('A connection has not been made to Verisure mypages.')
return False
alarms = []
alarms.extend([
VerisureAlarm(value)
for value in verisure.ALARM_STATUS.values()
if verisure.SHOW_ALARM
])
add_devices(alarms)
# pylint: disable=abstract-method
class VerisureAlarm(alarm.AlarmControlPanel):
""" Represents a Verisure alarm status. """
def __init__(self, alarm_status):
self._id = alarm_status.id
self._state = STATE_UNKNOWN
@property
def name(self):
""" Returns the name of the device. """
return 'Alarm {}'.format(self._id)
@property
def state(self):
""" Returns the state of the device. """
return self._state
@property
def code_format(self):
""" Four digit code required. """
return '^\\d{%s}$' % verisure.CODE_DIGITS
def update(self):
""" Update alarm status """
verisure.update_alarm()
if verisure.ALARM_STATUS[self._id].status == 'unarmed':
self._state = STATE_ALARM_DISARMED
elif verisure.ALARM_STATUS[self._id].status == 'armedhome':
self._state = STATE_ALARM_ARMED_HOME
elif verisure.ALARM_STATUS[self._id].status == 'armed':
self._state = STATE_ALARM_ARMED_AWAY
elif verisure.ALARM_STATUS[self._id].status != 'pending':
_LOGGER.error(
'Unknown alarm state %s',
verisure.ALARM_STATUS[self._id].status)
def alarm_disarm(self, code=None):
""" Send disarm command. """
verisure.MY_PAGES.alarm.set(code, 'DISARMED')
_LOGGER.info('verisure alarm disarming')
verisure.MY_PAGES.alarm.wait_while_pending()
verisure.update_alarm()
def alarm_arm_home(self, code=None):
""" Send arm home command. """
verisure.MY_PAGES.alarm.set(code, 'ARMED_HOME')
_LOGGER.info('verisure alarm arming home')
verisure.MY_PAGES.alarm.wait_while_pending()
verisure.update_alarm()
def alarm_arm_away(self, code=None):
""" Send arm away command. """
verisure.MY_PAGES.alarm.set(code, 'ARMED_AWAY')
_LOGGER.info('verisure alarm arming away')
verisure.MY_PAGES.alarm.wait_while_pending()
verisure.update_alarm()
+192
View File
@@ -0,0 +1,192 @@
"""
components.alexa
~~~~~~~~~~~~~~~~
Component to offer a service end point for an Alexa skill.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/alexa/
"""
import enum
import logging
from homeassistant.const import HTTP_OK, HTTP_UNPROCESSABLE_ENTITY
from homeassistant.util import template
from homeassistant.helpers.service import call_from_config
DOMAIN = 'alexa'
DEPENDENCIES = ['http']
_LOGGER = logging.getLogger(__name__)
_CONFIG = {}
API_ENDPOINT = '/api/alexa'
CONF_INTENTS = 'intents'
CONF_CARD = 'card'
CONF_SPEECH = 'speech'
CONF_ACTION = 'action'
def setup(hass, config):
""" Activate Alexa component. """
_CONFIG.update(config[DOMAIN].get(CONF_INTENTS, {}))
hass.http.register_path('POST', API_ENDPOINT, _handle_alexa, True)
return True
def _handle_alexa(handler, path_match, data):
""" Handle Alexa. """
_LOGGER.debug('Received Alexa request: %s', data)
req = data.get('request')
if req is None:
_LOGGER.error('Received invalid data from Alexa: %s', data)
handler.write_json_message(
"Invalid value received for port", HTTP_UNPROCESSABLE_ENTITY)
return
req_type = req['type']
if req_type == 'SessionEndedRequest':
handler.send_response(HTTP_OK)
handler.end_headers()
return
intent = req.get('intent')
response = AlexaResponse(handler.server.hass, intent)
if req_type == 'LaunchRequest':
response.add_speech(
SpeechType.plaintext,
"Hello, and welcome to the future. How may I help?")
handler.write_json(response.as_dict())
return
if req_type != 'IntentRequest':
_LOGGER.warning('Received unsupported request: %s', req_type)
return
intent_name = intent['name']
config = _CONFIG.get(intent_name)
if config is None:
_LOGGER.warning('Received unknown intent %s', intent_name)
response.add_speech(
SpeechType.plaintext,
"This intent is not yet configured within Home Assistant.")
handler.write_json(response.as_dict())
return
speech = config.get(CONF_SPEECH)
card = config.get(CONF_CARD)
action = config.get(CONF_ACTION)
# pylint: disable=unsubscriptable-object
if speech is not None:
response.add_speech(SpeechType[speech['type']], speech['text'])
if card is not None:
response.add_card(CardType[card['type']], card['title'],
card['content'])
if action is not None:
call_from_config(handler.server.hass, action, True)
handler.write_json(response.as_dict())
class SpeechType(enum.Enum):
""" Alexa speech types. """
plaintext = "PlainText"
ssml = "SSML"
class CardType(enum.Enum):
""" Alexa card types. """
simple = "Simple"
link_account = "LinkAccount"
class AlexaResponse(object):
""" Helps generating the response for Alexa. """
def __init__(self, hass, intent=None):
self.hass = hass
self.speech = None
self.card = None
self.reprompt = None
self.session_attributes = {}
self.should_end_session = True
if intent is not None and 'slots' in intent:
self.variables = {key: value['value'] for key, value
in intent['slots'].items() if 'value' in value}
else:
self.variables = {}
def add_card(self, card_type, title, content):
""" Add a card to the response. """
assert self.card is None
card = {
"type": card_type.value
}
if card_type == CardType.link_account:
self.card = card
return
card["title"] = self._render(title),
card["content"] = self._render(content)
self.card = card
def add_speech(self, speech_type, text):
""" Add speech to the response. """
assert self.speech is None
key = 'ssml' if speech_type == SpeechType.ssml else 'text'
self.speech = {
'type': speech_type.value,
key: self._render(text)
}
def add_reprompt(self, speech_type, text):
""" Add repromopt if user does not answer. """
assert self.reprompt is None
key = 'ssml' if speech_type == SpeechType.ssml else 'text'
self.reprompt = {
'type': speech_type.value,
key: self._render(text)
}
def as_dict(self):
""" Returns response in an Alexa valid dict. """
response = {
'shouldEndSession': self.should_end_session
}
if self.card is not None:
response['card'] = self.card
if self.speech is not None:
response['outputSpeech'] = self.speech
if self.reprompt is not None:
response['reprompt'] = {
'outputSpeech': self.reprompt
}
return {
'version': '1.0',
'sessionAttributes': self.session_attributes,
'response': response,
}
def _render(self, template_string):
""" Render a response, adding data from intent if available. """
return template.render(self.hass, template_string, self.variables)
+84
View File
@@ -0,0 +1,84 @@
"""
homeassistant.components.apcupsd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sets up and provides access to the status output of APCUPSd via its Network
Information Server (NIS).
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/apcupsd/
"""
import logging
from datetime import timedelta
from homeassistant.util import Throttle
DOMAIN = "apcupsd"
REQUIREMENTS = ("apcaccess==0.0.4",)
CONF_HOST = "host"
CONF_PORT = "port"
CONF_TYPE = "type"
DEFAULT_HOST = "localhost"
DEFAULT_PORT = 3551
KEY_STATUS = "STATUS"
VALUE_ONLINE = "ONLINE"
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)
DATA = None
_LOGGER = logging.getLogger(__name__)
def setup(hass, config):
""" Use config values to set up a function enabling status retrieval. """
global DATA
host = config[DOMAIN].get(CONF_HOST, DEFAULT_HOST)
port = config[DOMAIN].get(CONF_PORT, DEFAULT_PORT)
DATA = APCUPSdData(host, port)
# It doesn't really matter why we're not able to get the status, just that
# we can't.
# pylint: disable=broad-except
try:
DATA.update(no_throttle=True)
except Exception:
_LOGGER.exception("Failure while testing APCUPSd status retrieval.")
return False
return True
class APCUPSdData(object):
"""
Stores the data retrieved from APCUPSd for each entity to use, acts as the
single point responsible for fetching updates from the server.
"""
def __init__(self, host, port):
from apcaccess import status
self._host = host
self._port = port
self._status = None
self._get = status.get
self._parse = status.parse
@property
def status(self):
""" Get latest update if throttle allows. Return status. """
self.update()
return self._status
def _get_status(self):
""" Get the status from APCUPSd and parse it into a dict. """
return self._parse(self._get(host=self._host, port=self._port))
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self, **kwargs):
"""
Fetch the latest status from APCUPSd and store it in self._status.
"""
self._status = self._get_status()
+67 -11
View File
@@ -1,8 +1,10 @@
"""
homeassistant.components.api
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides a Rest API for Home Assistant.
For more details about the RESTful API, please refer to the documentation at
https://home-assistant.io/developers/api/
"""
import re
import logging
@@ -10,15 +12,19 @@ import threading
import json
import homeassistant.core as ha
from homeassistant.exceptions import TemplateError
from homeassistant.helpers.state import TrackStates
import homeassistant.remote as rem
from homeassistant.util import template
from homeassistant.bootstrap import ERROR_LOG_FILENAME
from homeassistant.const import (
URL_API, URL_API_STATES, URL_API_EVENTS, URL_API_SERVICES, URL_API_STREAM,
URL_API_EVENT_FORWARD, URL_API_STATES_ENTITY, URL_API_COMPONENTS,
URL_API_CONFIG, URL_API_BOOTSTRAP,
EVENT_TIME_CHANGED, EVENT_HOMEASSISTANT_STOP, MATCH_ALL,
URL_API_CONFIG, URL_API_BOOTSTRAP, URL_API_ERROR_LOG, URL_API_LOG_OUT,
URL_API_TEMPLATE, EVENT_TIME_CHANGED, EVENT_HOMEASSISTANT_STOP, MATCH_ALL,
HTTP_OK, HTTP_CREATED, HTTP_BAD_REQUEST, HTTP_NOT_FOUND,
HTTP_UNPROCESSABLE_ENTITY)
HTTP_UNPROCESSABLE_ENTITY, HTTP_HEADER_CONTENT_TYPE,
CONTENT_TYPE_TEXT_PLAIN)
DOMAIN = 'api'
@@ -33,10 +39,6 @@ _LOGGER = logging.getLogger(__name__)
def setup(hass, config):
""" Register the API with the HTTP interface. """
if 'http' not in hass.config.components:
_LOGGER.error('Dependency http is not loaded')
return False
# /api - for validation purposes
hass.http.register_path('GET', URL_API, _handle_get_api)
@@ -87,6 +89,14 @@ def setup(hass, config):
hass.http.register_path(
'GET', URL_API_COMPONENTS, _handle_get_api_components)
hass.http.register_path('GET', URL_API_ERROR_LOG,
_handle_get_api_error_log)
hass.http.register_path('POST', URL_API_LOG_OUT, _handle_post_api_log_out)
hass.http.register_path('POST', URL_API_TEMPLATE,
_handle_post_api_template)
return True
@@ -102,6 +112,11 @@ def _handle_get_api_stream(handler, path_match, data):
wfile = handler.wfile
write_lock = threading.Lock()
block = threading.Event()
session_id = None
restrict = data.get('restrict')
if restrict:
restrict = restrict.split(',')
def write_message(payload):
""" Writes a message to the output. """
@@ -111,7 +126,9 @@ def _handle_get_api_stream(handler, path_match, data):
try:
wfile.write(msg.encode("UTF-8"))
wfile.flush()
except IOError:
except (IOError, ValueError):
# IOError: socket errors
# ValueError: raised when 'I/O operation on closed file'
block.set()
def forward_events(event):
@@ -125,13 +142,19 @@ def _handle_get_api_stream(handler, path_match, data):
block.set()
return
handler.server.sessions.extend_validation(session_id)
write_message(json.dumps(event, cls=rem.JSONEncoder))
handler.send_response(HTTP_OK)
handler.send_header('Content-type', 'text/event-stream')
session_id = handler.set_session_cookie_header()
handler.end_headers()
hass.bus.listen(MATCH_ALL, forward_events)
if restrict:
for event in restrict:
hass.bus.listen(event, forward_events)
else:
hass.bus.listen(MATCH_ALL, forward_events)
while True:
write_message(STREAM_PING_PAYLOAD)
@@ -145,7 +168,11 @@ def _handle_get_api_stream(handler, path_match, data):
_LOGGER.info("Found broken event stream to %s, cleaning up",
handler.client_address[0])
hass.bus.remove_listener(MATCH_ALL, forward_events)
if restrict:
for event in restrict:
hass.bus.remove_listener(event, forward_events)
else:
hass.bus.remove_listener(MATCH_ALL, forward_events)
def _handle_get_api_config(handler, path_match, data):
@@ -334,6 +361,35 @@ def _handle_get_api_components(handler, path_match, data):
handler.write_json(handler.server.hass.config.components)
def _handle_get_api_error_log(handler, path_match, data):
""" Returns the logged errors for this session. """
handler.write_file(handler.server.hass.config.path(ERROR_LOG_FILENAME),
False)
def _handle_post_api_log_out(handler, path_match, data):
""" Log user out. """
handler.send_response(HTTP_OK)
handler.destroy_session()
handler.end_headers()
def _handle_post_api_template(handler, path_match, data):
""" Log user out. """
template_string = data.get('template', '')
try:
rendered = template.render(handler.server.hass, template_string)
handler.send_response(HTTP_OK)
handler.send_header(HTTP_HEADER_CONTENT_TYPE, CONTENT_TYPE_TEXT_PLAIN)
handler.end_headers()
handler.wfile.write(rendered.encode('utf-8'))
except TemplateError as e:
handler.write_json_message(str(e), HTTP_UNPROCESSABLE_ENTITY)
return
def _services_json(hass):
""" Generate services data to JSONify. """
return [{"domain": key, "services": value}
+4 -33
View File
@@ -4,40 +4,16 @@ components.arduino
Arduino component that connects to a directly attached Arduino board which
runs with the Firmata firmware.
Configuration:
To use the Arduino board you will need to add something like the following
to your configuration.yaml file.
arduino:
port: /dev/ttyACM0
Variables:
port
*Required
The port where is your board connected to your Home Assistant system.
If you are using an original Arduino the port will be named ttyACM*. The exact
number can be determined with 'ls /dev/ttyACM*' or check your 'dmesg'/
'journalctl -f' output. Keep in mind that Arduino clones are often using a
different name for the port (e.g. '/dev/ttyUSB*').
A word of caution: The Arduino is not storing states. This means that with
every initialization the pins are set to off/low.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/arduino/
"""
import logging
try:
from PyMata.pymata import PyMata
except ImportError:
PyMata = None
from homeassistant.helpers import validate_config
from homeassistant.const import (EVENT_HOMEASSISTANT_START,
EVENT_HOMEASSISTANT_STOP)
DOMAIN = "arduino"
DEPENDENCIES = []
REQUIREMENTS = ['PyMata==2.07a']
BOARD = None
_LOGGER = logging.getLogger(__name__)
@@ -46,18 +22,12 @@ _LOGGER = logging.getLogger(__name__)
def setup(hass, config):
""" Setup the Arduino component. """
global PyMata # pylint: disable=invalid-name
if PyMata is None:
from PyMata.pymata import PyMata as PyMata_
PyMata = PyMata_
import serial
if not validate_config(config,
{DOMAIN: ['port']},
_LOGGER):
return False
import serial
global BOARD
try:
BOARD = ArduinoBoard(config[DOMAIN]['port'])
@@ -86,6 +56,7 @@ class ArduinoBoard(object):
""" Represents an Arduino board. """
def __init__(self, port):
from PyMata.pymata import PyMata
self._port = port
self._board = PyMata(self._port, verbose=False)
+177 -43
View File
@@ -1,74 +1,208 @@
"""
homeassistant.components.automation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Allows to setup simple automation rules via the config file.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/automation/
"""
import logging
from homeassistant.bootstrap import prepare_setup_platform
from homeassistant.helpers import config_per_platform
from homeassistant.util import split_entity_id
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.const import CONF_PLATFORM
from homeassistant.components import logbook
from homeassistant.helpers.service import call_from_config
DOMAIN = "automation"
DOMAIN = 'automation'
DEPENDENCIES = ["group"]
DEPENDENCIES = ['group']
CONF_ALIAS = "alias"
CONF_SERVICE = "execute_service"
CONF_SERVICE_ENTITY_ID = "service_entity_id"
CONF_SERVICE_DATA = "service_data"
CONF_ALIAS = 'alias'
CONF_SERVICE = 'service'
CONF_CONDITION = 'condition'
CONF_ACTION = 'action'
CONF_TRIGGER = 'trigger'
CONF_CONDITION_TYPE = 'condition_type'
CONDITION_USE_TRIGGER_VALUES = 'use_trigger_values'
CONDITION_TYPE_AND = 'and'
CONDITION_TYPE_OR = 'or'
DEFAULT_CONDITION_TYPE = CONDITION_TYPE_AND
_LOGGER = logging.getLogger(__name__)
def setup(hass, config):
""" Sets up automation. """
success = False
config_key = DOMAIN
found = 1
for p_type, p_config in config_per_platform(config, DOMAIN, _LOGGER):
platform = prepare_setup_platform(hass, config, DOMAIN, p_type)
while config_key in config:
# check for one block syntax
if isinstance(config[config_key], dict):
config_block = _migrate_old_config(config[config_key])
name = config_block.get(CONF_ALIAS, config_key)
_setup_automation(hass, config_block, name, config)
if platform is None:
_LOGGER.error("Unknown automation platform specified: %s", p_type)
continue
# check for multiple block syntax
elif isinstance(config[config_key], list):
for list_no, config_block in enumerate(config[config_key]):
name = config_block.get(CONF_ALIAS,
"{}, {}".format(config_key, list_no))
_setup_automation(hass, config_block, name, config)
if platform.register(hass, p_config, _get_action(hass, p_config)):
_LOGGER.info(
"Initialized %s rule %s", p_type, p_config.get(CONF_ALIAS, ""))
success = True
# any scalar value is incorrect
else:
_LOGGER.error(
"Error setting up rule %s", p_config.get(CONF_ALIAS, ""))
_LOGGER.error('Error in config in section %s.', config_key)
return success
found += 1
config_key = "{} {}".format(DOMAIN, found)
return True
def _get_action(hass, config):
def _setup_automation(hass, config_block, name, config):
""" Setup one instance of automation """
action = _get_action(hass, config_block.get(CONF_ACTION, {}), name)
if action is None:
return False
if CONF_CONDITION in config_block or CONF_CONDITION_TYPE in config_block:
action = _process_if(hass, config, config_block, action)
if action is None:
return False
_process_trigger(hass, config, config_block.get(CONF_TRIGGER, []), name,
action)
return True
def _get_action(hass, config, name):
""" Return an action based on a config. """
if CONF_SERVICE not in config:
_LOGGER.error('Error setting up %s, no action specified.', name)
return None
def action():
""" Action to be executed. """
_LOGGER.info("Executing rule %s", config.get(CONF_ALIAS, ""))
_LOGGER.info('Executing %s', name)
logbook.log_entry(hass, name, 'has been triggered', DOMAIN)
if CONF_SERVICE in config:
domain, service = split_entity_id(config[CONF_SERVICE])
service_data = config.get(CONF_SERVICE_DATA, {})
if not isinstance(service_data, dict):
_LOGGER.error("%s should be a dictionary", CONF_SERVICE_DATA)
service_data = {}
if CONF_SERVICE_ENTITY_ID in config:
try:
service_data[ATTR_ENTITY_ID] = \
config[CONF_SERVICE_ENTITY_ID].split(",")
except AttributeError:
service_data[ATTR_ENTITY_ID] = \
config[CONF_SERVICE_ENTITY_ID]
hass.services.call(domain, service, service_data)
call_from_config(hass, config)
return action
def _migrate_old_config(config):
""" Migrate old config to new. """
if CONF_PLATFORM not in config:
return config
_LOGGER.warning(
'You are using an old configuration format. Please upgrade: '
'https://home-assistant.io/components/automation/')
new_conf = {
CONF_TRIGGER: dict(config),
CONF_CONDITION: config.get('if', []),
CONF_ACTION: dict(config),
}
for cat, key, new_key in (('trigger', 'mqtt_topic', 'topic'),
('trigger', 'mqtt_payload', 'payload'),
('trigger', 'state_entity_id', 'entity_id'),
('trigger', 'state_before', 'before'),
('trigger', 'state_after', 'after'),
('trigger', 'state_to', 'to'),
('trigger', 'state_from', 'from'),
('trigger', 'state_hours', 'hours'),
('trigger', 'state_minutes', 'minutes'),
('trigger', 'state_seconds', 'seconds'),
('action', 'execute_service', 'service'),
('action', 'service_entity_id', 'entity_id'),
('action', 'service_data', 'data')):
if key in new_conf[cat]:
new_conf[cat][new_key] = new_conf[cat].pop(key)
return new_conf
def _process_if(hass, config, p_config, action):
""" Processes if checks. """
cond_type = p_config.get(CONF_CONDITION_TYPE,
DEFAULT_CONDITION_TYPE).lower()
if_configs = p_config.get(CONF_CONDITION)
use_trigger = if_configs == CONDITION_USE_TRIGGER_VALUES
if use_trigger:
if_configs = p_config[CONF_TRIGGER]
if isinstance(if_configs, dict):
if_configs = [if_configs]
checks = []
for if_config in if_configs:
platform = _resolve_platform('if_action', hass, config,
if_config.get(CONF_PLATFORM))
if platform is None:
continue
check = platform.if_action(hass, if_config)
# Invalid conditions are allowed if we base it on trigger
if check is None and not use_trigger:
return None
checks.append(check)
if cond_type == CONDITION_TYPE_AND:
def if_action():
""" AND all conditions. """
if all(check() for check in checks):
action()
else:
def if_action():
""" OR all conditions. """
if any(check() for check in checks):
action()
return if_action
def _process_trigger(hass, config, trigger_configs, name, action):
""" Setup triggers. """
if isinstance(trigger_configs, dict):
trigger_configs = [trigger_configs]
for conf in trigger_configs:
platform = _resolve_platform('trigger', hass, config,
conf.get(CONF_PLATFORM))
if platform is None:
continue
if platform.trigger(hass, conf, action):
_LOGGER.info("Initialized rule %s", name)
else:
_LOGGER.error("Error setting up rule %s", name)
def _resolve_platform(method, hass, config, platform):
""" Find automation platform. """
if platform is None:
return None
platform = prepare_setup_platform(hass, config, DOMAIN, platform)
if platform is None or not hasattr(platform, method):
_LOGGER.error("Unknown automation platform specified for %s: %s",
method, platform)
return None
return platform
+7 -4
View File
@@ -1,8 +1,10 @@
"""
homeassistant.components.automation.event
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Offers event listening automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#event-trigger
"""
import logging
@@ -12,7 +14,7 @@ CONF_EVENT_DATA = "event_data"
_LOGGER = logging.getLogger(__name__)
def register(hass, config, action):
def trigger(hass, config, action):
""" Listen for events based on config. """
event_type = config.get(CONF_EVENT_TYPE)
@@ -20,11 +22,12 @@ def register(hass, config, action):
_LOGGER.error("Missing configuration key %s", CONF_EVENT_TYPE)
return False
event_data = config.get(CONF_EVENT_DATA, {})
event_data = config.get(CONF_EVENT_DATA)
def handle_event(event):
""" Listens for events and calls the action when data matches. """
if event_data == event.data:
if not event_data or all(val == event.data.get(key) for key, val
in event_data.items()):
action()
hass.bus.listen(event_type, handle_event)
+6 -4
View File
@@ -1,8 +1,10 @@
"""
homeassistant.components.automation.mqtt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Offers MQTT listening automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#mqtt-trigger
"""
import logging
@@ -10,11 +12,11 @@ import homeassistant.components.mqtt as mqtt
DEPENDENCIES = ['mqtt']
CONF_TOPIC = 'mqtt_topic'
CONF_PAYLOAD = 'mqtt_payload'
CONF_TOPIC = 'topic'
CONF_PAYLOAD = 'payload'
def register(hass, config, action):
def trigger(hass, config, action):
""" Listen for state changes based on `config`. """
topic = config.get(CONF_TOPIC)
payload = config.get(CONF_PAYLOAD)
@@ -0,0 +1,110 @@
"""
homeassistant.components.automation.numeric_state
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Offers numeric state listening automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#numeric-state-trigger
"""
from functools import partial
import logging
from homeassistant.const import CONF_VALUE_TEMPLATE
from homeassistant.helpers.event import track_state_change
from homeassistant.util import template
CONF_ENTITY_ID = "entity_id"
CONF_BELOW = "below"
CONF_ABOVE = "above"
_LOGGER = logging.getLogger(__name__)
def _renderer(hass, value_template, state):
"""Render state value."""
if value_template is None:
return state.state
return template.render(hass, value_template, {'state': state})
def trigger(hass, config, action):
""" Listen for state changes based on `config`. """
entity_id = config.get(CONF_ENTITY_ID)
if entity_id is None:
_LOGGER.error("Missing configuration key %s", CONF_ENTITY_ID)
return False
below = config.get(CONF_BELOW)
above = config.get(CONF_ABOVE)
value_template = config.get(CONF_VALUE_TEMPLATE)
if below is None and above is None:
_LOGGER.error("Missing configuration key."
" One of %s or %s is required",
CONF_BELOW, CONF_ABOVE)
return False
renderer = partial(_renderer, hass, value_template)
# pylint: disable=unused-argument
def state_automation_listener(entity, from_s, to_s):
""" Listens for state changes and calls action. """
# Fire action if we go from outside range into range
if _in_range(above, below, renderer(to_s)) and \
(from_s is None or not _in_range(above, below, renderer(from_s))):
action()
track_state_change(
hass, entity_id, state_automation_listener)
return True
def if_action(hass, config):
""" Wraps action method with state based condition. """
entity_id = config.get(CONF_ENTITY_ID)
if entity_id is None:
_LOGGER.error("Missing configuration key %s", CONF_ENTITY_ID)
return None
below = config.get(CONF_BELOW)
above = config.get(CONF_ABOVE)
value_template = config.get(CONF_VALUE_TEMPLATE)
if below is None and above is None:
_LOGGER.error("Missing configuration key."
" One of %s or %s is required",
CONF_BELOW, CONF_ABOVE)
return None
renderer = partial(_renderer, hass, value_template)
def if_numeric_state():
""" Test numeric state condition. """
state = hass.states.get(entity_id)
return state is not None and _in_range(above, below, renderer(state))
return if_numeric_state
def _in_range(range_start, range_end, value):
""" Checks if value is inside the range """
try:
value = float(value)
except ValueError:
_LOGGER.warning("Value returned from template is not a number: %s",
value)
return False
if range_start is not None and range_end is not None:
return float(range_start) <= value < float(range_end)
elif range_end is not None:
return value < float(range_end)
else:
return float(range_start) <= value
+35 -7
View File
@@ -1,8 +1,10 @@
"""
homeassistant.components.automation.state
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Offers state listening automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#state-trigger
"""
import logging
@@ -10,22 +12,28 @@ from homeassistant.helpers.event import track_state_change
from homeassistant.const import MATCH_ALL
CONF_ENTITY_ID = "state_entity_id"
CONF_FROM = "state_from"
CONF_TO = "state_to"
CONF_ENTITY_ID = "entity_id"
CONF_FROM = "from"
CONF_TO = "to"
CONF_STATE = "state"
def register(hass, config, action):
def trigger(hass, config, action):
""" Listen for state changes based on `config`. """
entity_id = config.get(CONF_ENTITY_ID)
if entity_id is None:
logging.getLogger(__name__).error(
"Missing configuration key %s", CONF_ENTITY_ID)
"Missing trigger configuration key %s", CONF_ENTITY_ID)
return False
from_state = config.get(CONF_FROM, MATCH_ALL)
to_state = config.get(CONF_TO, MATCH_ALL)
to_state = config.get(CONF_TO) or config.get(CONF_STATE) or MATCH_ALL
if isinstance(from_state, bool) or isinstance(to_state, bool):
logging.getLogger(__name__).error(
'Config error. Surround to/from values with quotes.')
return False
def state_automation_listener(entity, from_s, to_s):
""" Listens for state changes and calls action. """
@@ -35,3 +43,23 @@ def register(hass, config, action):
hass, entity_id, state_automation_listener, from_state, to_state)
return True
def if_action(hass, config):
""" Wraps action method with state based condition. """
entity_id = config.get(CONF_ENTITY_ID)
state = config.get(CONF_STATE)
if entity_id is None or state is None:
logging.getLogger(__name__).error(
"Missing if-condition configuration key %s or %s", CONF_ENTITY_ID,
CONF_STATE)
return None
state = str(state)
def if_state():
""" Test if condition. """
return hass.states.is_state(entity_id, state)
return if_state
+148
View File
@@ -0,0 +1,148 @@
"""
homeassistant.components.automation.sun
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Offers sun based automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#sun-trigger
"""
import logging
from datetime import timedelta
from homeassistant.components import sun
from homeassistant.helpers.event import track_sunrise, track_sunset
import homeassistant.util.dt as dt_util
DEPENDENCIES = ['sun']
CONF_OFFSET = 'offset'
CONF_EVENT = 'event'
CONF_BEFORE = "before"
CONF_BEFORE_OFFSET = "before_offset"
CONF_AFTER = "after"
CONF_AFTER_OFFSET = "after_offset"
EVENT_SUNSET = 'sunset'
EVENT_SUNRISE = 'sunrise'
_LOGGER = logging.getLogger(__name__)
def trigger(hass, config, action):
""" Listen for events based on config. """
event = config.get(CONF_EVENT)
if event is None:
_LOGGER.error("Missing configuration key %s", CONF_EVENT)
return False
event = event.lower()
if event not in (EVENT_SUNRISE, EVENT_SUNSET):
_LOGGER.error("Invalid value for %s: %s", CONF_EVENT, event)
return False
offset = _parse_offset(config.get(CONF_OFFSET))
if offset is False:
return False
# Do something to call action
if event == EVENT_SUNRISE:
track_sunrise(hass, action, offset)
else:
track_sunset(hass, action, offset)
return True
def if_action(hass, config):
""" Wraps action method with sun based condition. """
before = config.get(CONF_BEFORE)
after = config.get(CONF_AFTER)
# Make sure required configuration keys are present
if before is None and after is None:
logging.getLogger(__name__).error(
"Missing if-condition configuration key %s or %s",
CONF_BEFORE, CONF_AFTER)
return None
# Make sure configuration keys have the right value
if before not in (None, EVENT_SUNRISE, EVENT_SUNSET) or \
after not in (None, EVENT_SUNRISE, EVENT_SUNSET):
logging.getLogger(__name__).error(
"%s and %s can only be set to %s or %s",
CONF_BEFORE, CONF_AFTER, EVENT_SUNRISE, EVENT_SUNSET)
return None
before_offset = _parse_offset(config.get(CONF_BEFORE_OFFSET))
after_offset = _parse_offset(config.get(CONF_AFTER_OFFSET))
if before_offset is False or after_offset is False:
return None
if before is None:
def before_func():
"""Return no point in time."""
return None
elif before == EVENT_SUNRISE:
def before_func():
"""Return time before sunrise."""
return sun.next_rising(hass) + before_offset
else:
def before_func():
"""Return time before sunset."""
return sun.next_setting(hass) + before_offset
if after is None:
def after_func():
"""Return no point in time."""
return None
elif after == EVENT_SUNRISE:
def after_func():
"""Return time after sunrise."""
return sun.next_rising(hass) + after_offset
else:
def after_func():
"""Return time after sunset."""
return sun.next_setting(hass) + after_offset
def time_if():
""" Validate time based if-condition """
now = dt_util.now()
before = before_func()
after = after_func()
if before is not None and now > now.replace(hour=before.hour,
minute=before.minute):
return False
if after is not None and now < now.replace(hour=after.hour,
minute=after.minute):
return False
return True
return time_if
def _parse_offset(raw_offset):
if raw_offset is None:
return timedelta(0)
negative_offset = False
if raw_offset.startswith('-'):
negative_offset = True
raw_offset = raw_offset[1:]
try:
(hour, minute, second) = [int(x) for x in raw_offset.split(':')]
except ValueError:
_LOGGER.error('Could not parse offset %s', raw_offset)
return False
offset = timedelta(hours=hour, minutes=minute, seconds=second)
if negative_offset:
offset *= -1
return offset
@@ -0,0 +1,65 @@
"""
homeassistant.components.automation.template
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Offers template automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#template-trigger
"""
import logging
from homeassistant.const import CONF_VALUE_TEMPLATE, EVENT_STATE_CHANGED
from homeassistant.exceptions import TemplateError
from homeassistant.util import template
_LOGGER = logging.getLogger(__name__)
def trigger(hass, config, action):
""" Listen for state changes based on `config`. """
value_template = config.get(CONF_VALUE_TEMPLATE)
if value_template is None:
_LOGGER.error("Missing configuration key %s", CONF_VALUE_TEMPLATE)
return False
# Local variable to keep track of if the action has already been triggered
already_triggered = False
def event_listener(event):
""" Listens for state changes and calls action. """
nonlocal already_triggered
template_result = _check_template(hass, value_template)
# Check to see if template returns true
if template_result and not already_triggered:
already_triggered = True
action()
elif not template_result:
already_triggered = False
hass.bus.listen(EVENT_STATE_CHANGED, event_listener)
return True
def if_action(hass, config):
""" Wraps action method with state based condition. """
value_template = config.get(CONF_VALUE_TEMPLATE)
if value_template is None:
_LOGGER.error("Missing configuration key %s", CONF_VALUE_TEMPLATE)
return False
return lambda: _check_template(hass, value_template)
def _check_template(hass, value_template):
""" Checks if result of template is true """
try:
value = template.render(hass, value_template, {})
except TemplateError:
_LOGGER.exception('Error parsing template')
return False
return value.lower() == 'true'
+87 -9
View File
@@ -1,22 +1,45 @@
"""
homeassistant.components.automation.time
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Offers time listening automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#time-trigger
"""
from homeassistant.util import convert
import logging
import homeassistant.util.dt as dt_util
from homeassistant.helpers.event import track_time_change
CONF_HOURS = "time_hours"
CONF_MINUTES = "time_minutes"
CONF_SECONDS = "time_seconds"
CONF_HOURS = "hours"
CONF_MINUTES = "minutes"
CONF_SECONDS = "seconds"
CONF_BEFORE = "before"
CONF_AFTER = "after"
CONF_WEEKDAY = "weekday"
WEEKDAYS = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']
_LOGGER = logging.getLogger(__name__)
def register(hass, config, action):
def trigger(hass, config, action):
""" Listen for state changes based on `config`. """
hours = convert(config.get(CONF_HOURS), int)
minutes = convert(config.get(CONF_MINUTES), int)
seconds = convert(config.get(CONF_SECONDS), int)
if CONF_AFTER in config:
after = dt_util.parse_time_str(config[CONF_AFTER])
if after is None:
_error_time(config[CONF_AFTER], CONF_AFTER)
return False
hours, minutes, seconds = after.hour, after.minute, after.second
elif (CONF_HOURS in config or CONF_MINUTES in config or
CONF_SECONDS in config):
hours = config.get(CONF_HOURS)
minutes = config.get(CONF_MINUTES)
seconds = config.get(CONF_SECONDS)
else:
_LOGGER.error('One of %s, %s, %s OR %s needs to be specified',
CONF_HOURS, CONF_MINUTES, CONF_SECONDS, CONF_AFTER)
return False
def time_automation_listener(now):
""" Listens for time changes and calls action. """
@@ -26,3 +49,58 @@ def register(hass, config, action):
hour=hours, minute=minutes, second=seconds)
return True
def if_action(hass, config):
""" Wraps action method with time based condition. """
before = config.get(CONF_BEFORE)
after = config.get(CONF_AFTER)
weekday = config.get(CONF_WEEKDAY)
if before is None and after is None and weekday is None:
_LOGGER.error(
"Missing if-condition configuration key %s, %s or %s",
CONF_BEFORE, CONF_AFTER, CONF_WEEKDAY)
return None
if before is not None:
before = dt_util.parse_time_str(before)
if before is None:
_error_time(before, CONF_BEFORE)
return None
if after is not None:
after = dt_util.parse_time_str(after)
if after is None:
_error_time(after, CONF_AFTER)
return None
def time_if():
""" Validate time based if-condition """
now = dt_util.now()
if before is not None and now > now.replace(hour=before.hour,
minute=before.minute):
return False
if after is not None and now < now.replace(hour=after.hour,
minute=after.minute):
return False
if weekday is not None:
now_weekday = WEEKDAYS[now.weekday()]
if isinstance(weekday, str) and weekday != now_weekday or \
now_weekday not in weekday:
return False
return True
return time_if
def _error_time(value, key):
""" Helper method to print error. """
_LOGGER.error(
"Received invalid value for '%s': %s", key, value)
if isinstance(value, int):
_LOGGER.error('Make sure you wrap time values in quotes')
@@ -0,0 +1,88 @@
"""
homeassistant.components.automation.zone
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Offers zone automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#zone-trigger
"""
import logging
from homeassistant.components import zone
from homeassistant.helpers.event import track_state_change
from homeassistant.const import (
ATTR_GPS_ACCURACY, ATTR_LATITUDE, ATTR_LONGITUDE, MATCH_ALL)
CONF_ENTITY_ID = "entity_id"
CONF_ZONE = "zone"
CONF_EVENT = "event"
EVENT_ENTER = "enter"
EVENT_LEAVE = "leave"
DEFAULT_EVENT = EVENT_ENTER
def trigger(hass, config, action):
""" Listen for state changes based on `config`. """
entity_id = config.get(CONF_ENTITY_ID)
zone_entity_id = config.get(CONF_ZONE)
if entity_id is None or zone_entity_id is None:
logging.getLogger(__name__).error(
"Missing trigger configuration key %s or %s", CONF_ENTITY_ID,
CONF_ZONE)
return False
event = config.get(CONF_EVENT, DEFAULT_EVENT)
def zone_automation_listener(entity, from_s, to_s):
""" Listens for state changes and calls action. """
if from_s and None in (from_s.attributes.get(ATTR_LATITUDE),
from_s.attributes.get(ATTR_LONGITUDE)) or \
None in (to_s.attributes.get(ATTR_LATITUDE),
to_s.attributes.get(ATTR_LONGITUDE)):
return
from_match = _in_zone(hass, zone_entity_id, from_s) if from_s else None
to_match = _in_zone(hass, zone_entity_id, to_s)
# pylint: disable=too-many-boolean-expressions
if event == EVENT_ENTER and not from_match and to_match or \
event == EVENT_LEAVE and from_match and not to_match:
action()
track_state_change(
hass, entity_id, zone_automation_listener, MATCH_ALL, MATCH_ALL)
return True
def if_action(hass, config):
""" Wraps action method with zone based condition. """
entity_id = config.get(CONF_ENTITY_ID)
zone_entity_id = config.get(CONF_ZONE)
if entity_id is None or zone_entity_id is None:
logging.getLogger(__name__).error(
"Missing condition configuration key %s or %s", CONF_ENTITY_ID,
CONF_ZONE)
return False
def if_in_zone():
""" Test if condition. """
return _in_zone(hass, zone_entity_id, hass.states.get(entity_id))
return if_in_zone
def _in_zone(hass, zone_entity_id, state):
""" Check if state is in zone. """
if not state or None in (state.attributes.get(ATTR_LATITUDE),
state.attributes.get(ATTR_LONGITUDE)):
return False
zone_state = hass.states.get(zone_entity_id)
return zone_state and zone.in_zone(
zone_state, state.attributes.get(ATTR_LATITUDE),
state.attributes.get(ATTR_LONGITUDE),
state.attributes.get(ATTR_GPS_ACCURACY, 0))
@@ -0,0 +1,49 @@
"""
homeassistant.components.binary_sensor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Component to interface with binary sensors (sensors which only know two states)
that can be monitored.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/binary_sensor/
"""
import logging
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.entity import Entity
from homeassistant.const import (STATE_ON, STATE_OFF)
DOMAIN = 'binary_sensor'
SCAN_INTERVAL = 30
ENTITY_ID_FORMAT = DOMAIN + '.{}'
def setup(hass, config):
""" Track states and offer events for binary sensors. """
component = EntityComponent(
logging.getLogger(__name__), DOMAIN, hass, SCAN_INTERVAL)
component.setup(config)
return True
# pylint: disable=no-self-use
class BinarySensorDevice(Entity):
""" Represents a binary sensor. """
@property
def is_on(self):
""" True if the binary sensor is on. """
return None
@property
def state(self):
""" Returns the state of the binary sensor. """
return STATE_ON if self.is_on else STATE_OFF
@property
def friendly_state(self):
""" Returns the friendly state of the binary sensor. """
return None
@@ -0,0 +1,44 @@
"""
homeassistant.components.binary_sensor.apcupsd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides a binary sensor to track online status of a UPS.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.apcupsd/
"""
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components import apcupsd
DEPENDENCIES = [apcupsd.DOMAIN]
DEFAULT_NAME = "UPS Online Status"
def setup_platform(hass, config, add_entities, discovery_info=None):
""" Instantiate an OnlineStatus binary sensor entity and add it to HA. """
add_entities((OnlineStatus(config, apcupsd.DATA),))
class OnlineStatus(BinarySensorDevice):
""" Binary sensor to represent UPS online status. """
def __init__(self, config, data):
self._config = config
self._data = data
self._state = None
self.update()
@property
def name(self):
""" The name of the UPS online status sensor. """
return self._config.get("name", DEFAULT_NAME)
@property
def is_on(self):
""" True if the UPS is online, else False. """
return self._state == apcupsd.VALUE_ONLINE
def update(self):
"""
Get the status report from APCUPSd (or cache) and set this entity's
state.
"""
self._state = self._data.status[apcupsd.KEY_STATUS]
@@ -0,0 +1,107 @@
"""
homeassistant.components.binary_sensor.arest
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The arest sensor will consume an exposed aREST API of a device.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.arest/
"""
from datetime import timedelta
import logging
import requests
from homeassistant.util import Throttle
from homeassistant.components.binary_sensor import BinarySensorDevice
_LOGGER = logging.getLogger(__name__)
# Return cached results if last scan was less then this time ago
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=30)
CONF_RESOURCE = 'resource'
CONF_PIN = 'pin'
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Get the aREST binary sensor. """
resource = config.get(CONF_RESOURCE)
pin = config.get(CONF_PIN)
if None in (resource, pin):
_LOGGER.error('Not all required config keys present: %s',
', '.join((CONF_RESOURCE, CONF_PIN)))
return False
try:
response = requests.get(resource, timeout=10).json()
except requests.exceptions.MissingSchema:
_LOGGER.error('Missing resource or schema in configuration. '
'Add http:// to your URL.')
return False
except requests.exceptions.ConnectionError:
_LOGGER.error('No route to device at %s. '
'Please check the IP address in the configuration file.',
resource)
return False
arest = ArestData(resource, pin)
add_devices([ArestBinarySensor(arest,
resource,
config.get('name', response['name']),
pin)])
# pylint: disable=too-many-instance-attributes, too-many-arguments
class ArestBinarySensor(BinarySensorDevice):
""" Implements an aREST binary sensor for a pin. """
def __init__(self, arest, resource, name, pin):
self.arest = arest
self._resource = resource
self._name = name
self._pin = pin
self.update()
if self._pin is not None:
request = requests.get('{}/mode/{}/i'.format
(self._resource, self._pin), timeout=10)
if request.status_code is not 200:
_LOGGER.error("Can't set mode. Is device offline?")
@property
def name(self):
""" The name of the binary sensor. """
return self._name
@property
def is_on(self):
""" True if the binary sensor is on. """
return bool(self.arest.data.get('state'))
def update(self):
""" Gets the latest data from aREST API. """
self.arest.update()
# pylint: disable=too-few-public-methods
class ArestData(object):
""" Class for handling the data retrieval for pins. """
def __init__(self, resource, pin):
self._resource = resource
self._pin = pin
self.data = {}
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self):
""" Gets the latest data from aREST device. """
try:
response = requests.get('{}/digital/{}'.format(
self._resource, self._pin), timeout=10)
self.data = {'state': response.json()['return_value']}
except requests.exceptions.ConnectionError:
_LOGGER.error("No route to device '%s'. Is device offline?",
self._resource)
@@ -0,0 +1,84 @@
"""
homeassistant.components.binary_sensor.command_sensor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Allows to configure custom shell commands to turn a value
into a logical value for a binary sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.command/
"""
import logging
from datetime import timedelta
from homeassistant.const import CONF_VALUE_TEMPLATE
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.sensor.command_sensor import CommandSensorData
from homeassistant.util import template
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = "Binary Command Sensor"
DEFAULT_PAYLOAD_ON = 'ON'
DEFAULT_PAYLOAD_OFF = 'OFF'
# Return cached results if last scan was less then this time ago
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=60)
# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Add the Command Sensor. """
if config.get('command') is None:
_LOGGER.error('Missing required variable: "command"')
return False
data = CommandSensorData(config.get('command'))
add_devices([CommandBinarySensor(
hass,
data,
config.get('name', DEFAULT_NAME),
config.get('payload_on', DEFAULT_PAYLOAD_ON),
config.get('payload_off', DEFAULT_PAYLOAD_OFF),
config.get(CONF_VALUE_TEMPLATE)
)])
# pylint: disable=too-many-arguments
class CommandBinarySensor(BinarySensorDevice):
""" Represents a binary sensor that is returning
a value of a shell commands. """
def __init__(self, hass, data, name, payload_on,
payload_off, value_template):
self._hass = hass
self.data = data
self._name = name
self._state = False
self._payload_on = payload_on
self._payload_off = payload_off
self._value_template = value_template
self.update()
@property
def name(self):
""" The name of the sensor. """
return self._name
@property
def is_on(self):
""" True if the binary sensor is on. """
return self._state
def update(self):
""" Gets the latest data and updates the state. """
self.data.update()
value = self.data.value
if self._value_template is not None:
value = template.render_with_possible_json_value(
self._hass, self._value_template, value, False)
if value == self._payload_on:
self._state = True
elif value == self._payload_off:
self._state = False
@@ -0,0 +1,37 @@
"""
homeassistant.components.binary_sensor.demo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo platform that has two fake binary sensors.
"""
from homeassistant.components.binary_sensor import BinarySensorDevice
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the Demo binary sensors. """
add_devices([
DemoBinarySensor('Basement Floor Wet', False),
DemoBinarySensor('Movement Backyard', True),
])
class DemoBinarySensor(BinarySensorDevice):
""" A Demo binary sensor. """
def __init__(self, name, state):
self._name = name
self._state = state
@property
def should_poll(self):
""" No polling needed for a demo binary sensor. """
return False
@property
def name(self):
""" Returns the name of the binary sensor. """
return self._name
@property
def is_on(self):
""" True if the binary sensor is on. """
return self._state
@@ -0,0 +1,84 @@
"""
homeassistant.components.binary_sensor.mqtt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Allows to configure a MQTT binary sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.mqtt/
"""
import logging
from homeassistant.const import CONF_VALUE_TEMPLATE
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.util import template
import homeassistant.components.mqtt as mqtt
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'MQTT Binary sensor'
DEFAULT_QOS = 0
DEFAULT_PAYLOAD_ON = 'ON'
DEFAULT_PAYLOAD_OFF = 'OFF'
DEPENDENCIES = ['mqtt']
# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Add MQTT binary sensor. """
if config.get('state_topic') is None:
_LOGGER.error('Missing required variable: state_topic')
return False
add_devices([MqttBinarySensor(
hass,
config.get('name', DEFAULT_NAME),
config.get('state_topic', None),
config.get('qos', DEFAULT_QOS),
config.get('payload_on', DEFAULT_PAYLOAD_ON),
config.get('payload_off', DEFAULT_PAYLOAD_OFF),
config.get(CONF_VALUE_TEMPLATE))])
# pylint: disable=too-many-arguments, too-many-instance-attributes
class MqttBinarySensor(BinarySensorDevice):
""" Represents a binary sensor that is updated by MQTT. """
def __init__(self, hass, name, state_topic, qos, payload_on, payload_off,
value_template):
self._hass = hass
self._name = name
self._state = False
self._state_topic = state_topic
self._payload_on = payload_on
self._payload_off = payload_off
self._qos = qos
def message_received(topic, payload, qos):
""" A new MQTT message has been received. """
if value_template is not None:
payload = template.render_with_possible_json_value(
hass, value_template, payload)
if payload == self._payload_on:
self._state = True
self.update_ha_state()
elif payload == self._payload_off:
self._state = False
self.update_ha_state()
mqtt.subscribe(hass, self._state_topic, message_received, self._qos)
@property
def should_poll(self):
""" No polling needed. """
return False
@property
def name(self):
""" The name of the binary sensor. """
return self._name
@property
def is_on(self):
""" True if the binary sensor is on. """
return self._state
@@ -0,0 +1,56 @@
"""
homeassistant.components.binary_sensor.nest
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for Nest Thermostat Binary Sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.nest/
"""
import logging
import socket
import homeassistant.components.nest as nest
from homeassistant.components.sensor.nest import NestSensor
from homeassistant.components.binary_sensor import BinarySensorDevice
DEPENDENCIES = ['nest']
BINARY_TYPES = ['fan',
'hvac_ac_state',
'hvac_aux_heater_state',
'hvac_heater_state',
'hvac_heat_x2_state',
'hvac_heat_x3_state',
'hvac_alt_heat_state',
'hvac_alt_heat_x2_state',
'hvac_emer_heat_state',
'online']
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Setup Nest binary sensors. """
logger = logging.getLogger(__name__)
try:
for structure in nest.NEST.structures:
for device in structure.devices:
for variable in config['monitored_conditions']:
if variable in BINARY_TYPES:
add_devices([NestBinarySensor(structure,
device,
variable)])
else:
logger.error('Nest sensor type: "%s" does not exist',
variable)
except socket.error:
logger.error(
"Connection error logging into the nest web service."
)
class NestBinarySensor(NestSensor, BinarySensorDevice):
""" Represents a Nest binary sensor. """
@property
def is_on(self):
""" True if the binary sensor is on. """
return bool(getattr(self.device, self.variable))
@@ -0,0 +1,73 @@
"""
homeassistant.components.binary_sensor.rest
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The rest binary sensor will consume responses sent by an exposed REST API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.rest/
"""
import logging
from homeassistant.const import CONF_VALUE_TEMPLATE
from homeassistant.util import template
from homeassistant.components.sensor.rest import RestData
from homeassistant.components.binary_sensor import BinarySensorDevice
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'REST Binary Sensor'
DEFAULT_METHOD = 'GET'
# pylint: disable=unused-variable
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Setup REST binary sensors. """
resource = config.get('resource', None)
method = config.get('method', DEFAULT_METHOD)
payload = config.get('payload', None)
verify_ssl = config.get('verify_ssl', True)
rest = RestData(method, resource, payload, verify_ssl)
rest.update()
if rest.data is None:
_LOGGER.error('Unable to fetch Rest data')
return False
add_devices([RestBinarySensor(
hass, rest, config.get('name', DEFAULT_NAME),
config.get(CONF_VALUE_TEMPLATE))])
# pylint: disable=too-many-arguments
class RestBinarySensor(BinarySensorDevice):
""" A REST binary sensor. """
def __init__(self, hass, rest, name, value_template):
""" Initialize a REST binary sensor. """
self._hass = hass
self.rest = rest
self._name = name
self._state = False
self._value_template = value_template
self.update()
@property
def name(self):
""" Name of the binary sensor. """
return self._name
@property
def is_on(self):
""" Return if the binary sensor is on. """
if self.rest.data is None:
return False
if self._value_template is not None:
self.rest.data = template.render_with_possible_json_value(
self._hass, self._value_template, self.rest.data, False)
return bool(int(self.rest.data))
def update(self):
""" Get the latest data from REST API and updates the state. """
self.rest.update()
@@ -0,0 +1,73 @@
"""
homeassistant.components.binary_sensor.rpi_gpio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Allows to configure a binary sensor using RPi GPIO.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.rpi_gpio/
"""
import logging
import homeassistant.components.rpi_gpio as rpi_gpio
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.const import (DEVICE_DEFAULT_NAME)
DEFAULT_PULL_MODE = "UP"
DEFAULT_BOUNCETIME = 50
DEFAULT_INVERT_LOGIC = False
DEPENDENCIES = ['rpi_gpio']
_LOGGER = logging.getLogger(__name__)
# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the Raspberry PI GPIO devices. """
pull_mode = config.get('pull_mode', DEFAULT_PULL_MODE)
bouncetime = config.get('bouncetime', DEFAULT_BOUNCETIME)
invert_logic = config.get('invert_logic', DEFAULT_INVERT_LOGIC)
binary_sensors = []
ports = config.get('ports')
for port_num, port_name in ports.items():
binary_sensors.append(RPiGPIOBinarySensor(
port_name, port_num, pull_mode, bouncetime, invert_logic))
add_devices(binary_sensors)
# pylint: disable=too-many-arguments, too-many-instance-attributes
class RPiGPIOBinarySensor(BinarySensorDevice):
""" Represents a binary sensor that uses Raspberry Pi GPIO. """
def __init__(self, name, port, pull_mode, bouncetime, invert_logic):
# pylint: disable=no-member
self._name = name or DEVICE_DEFAULT_NAME
self._port = port
self._pull_mode = pull_mode
self._bouncetime = bouncetime
self._invert_logic = invert_logic
rpi_gpio.setup_input(self._port, self._pull_mode)
self._state = rpi_gpio.read_input(self._port)
def read_gpio(port):
""" Reads state from GPIO. """
self._state = rpi_gpio.read_input(self._port)
self.update_ha_state()
rpi_gpio.edge_detect(self._port, read_gpio, self._bouncetime)
@property
def should_poll(self):
""" No polling needed. """
return False
@property
def name(self):
""" The name of the sensor. """
return self._name
@property
def is_on(self):
""" Returns the state of the entity. """
return self._state != self._invert_logic
@@ -0,0 +1,29 @@
"""
homeassistant.components.binary_sensor.zigbee
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Contains functionality to use a ZigBee device as a binary sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.zigbee/
"""
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.zigbee import (
ZigBeeDigitalIn, ZigBeeDigitalInConfig)
DEPENDENCIES = ["zigbee"]
def setup_platform(hass, config, add_entities, discovery_info=None):
""" Create and add an entity based on the configuration. """
add_entities([
ZigBeeBinarySensor(hass, ZigBeeDigitalInConfig(config))
])
class ZigBeeBinarySensor(ZigBeeDigitalIn, BinarySensorDevice):
"""
Use multiple inheritance to turn a ZigBeeDigitalIn into a
BinarySensorDevice.
"""
pass
+77
View File
@@ -0,0 +1,77 @@
"""
homeassistant.components.bloomsky
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for BloomSky weather station.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/bloomsky/
"""
import logging
from datetime import timedelta
import requests
from homeassistant.util import Throttle
from homeassistant.helpers import validate_config
from homeassistant.const import CONF_API_KEY
DOMAIN = "bloomsky"
BLOOMSKY = None
_LOGGER = logging.getLogger(__name__)
# The BloomSky only updates every 5-8 minutes as per the API spec so there's
# no point in polling the API more frequently
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=300)
# pylint: disable=unused-argument,too-few-public-methods
def setup(hass, config):
""" Setup BloomSky component. """
if not validate_config(
config,
{DOMAIN: [CONF_API_KEY]},
_LOGGER):
return False
api_key = config[DOMAIN][CONF_API_KEY]
global BLOOMSKY
try:
BLOOMSKY = BloomSky(api_key)
except RuntimeError:
return False
return True
class BloomSky(object):
""" Handle all communication with the BloomSky API. """
# API documentation at http://weatherlution.com/bloomsky-api/
API_URL = "https://api.bloomsky.com/api/skydata"
def __init__(self, api_key):
self._api_key = api_key
self.devices = {}
_LOGGER.debug("Initial bloomsky device load...")
self.refresh_devices()
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def refresh_devices(self):
"""
Uses the API to retreive a list of devices associated with an
account along with all the sensors on the device.
"""
_LOGGER.debug("Fetching bloomsky update")
response = requests.get(self.API_URL,
headers={"Authorization": self._api_key},
timeout=10)
if response.status_code == 401:
raise RuntimeError("Invalid API_KEY")
elif response.status_code != 200:
_LOGGER.error("Invalid HTTP response: %s", response.status_code)
return
# create dictionary keyed off of the device unique id
self.devices.update({
device["DeviceID"]: device for device in response.json()
})
+3 -2
View File
@@ -1,12 +1,13 @@
"""
homeassistant.components.browser
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to launch a webbrowser on the host machine.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/browser/
"""
DOMAIN = "browser"
DEPENDENCIES = []
SERVICE_BROWSE_URL = "browse_url"
+60 -71
View File
@@ -4,38 +4,23 @@ homeassistant.components.camera
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Component to interface with various cameras.
The following features are supported:
- Returning recorded camera images and streams
- Proxying image requests via HA for external access
- Converting a still image url into a live video stream
Upcoming features
- Recording
- Snapshot
- Motion Detection Recording(for supported cameras)
- Automatic Configuration(for supported cameras)
- Creation of child entities for supported functions
- Collating motion event images passed via FTP into time based events
- A service for calling camera functions
- Camera movement(panning)
- Zoom
- Light/Nightvision toggling
- Support for more devices
- Expanded documentation
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/camera/
"""
import requests
import logging
import time
import re
import time
import requests
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.const import (
ATTR_ENTITY_PICTURE,
HTTP_NOT_FOUND,
ATTR_ENTITY_ID,
)
from homeassistant.helpers.entity_component import EntityComponent
DOMAIN = 'camera'
DEPENDENCIES = ['http']
@@ -48,8 +33,6 @@ SWITCH_ACTION_SNAPSHOT = 'snapshot'
SERVICE_CAMERA = 'camera_service'
STATE_RECORDING = 'recording'
DEFAULT_RECORDING_SECONDS = 30
# Maps discovered services to their platforms
@@ -61,6 +44,7 @@ DIR_DATETIME_FORMAT = '%Y-%m-%d_%H-%M-%S'
REC_DIR_PREFIX = 'recording-'
REC_IMG_PREFIX = 'recording_image-'
STATE_RECORDING = 'recording'
STATE_STREAMING = 'streaming'
STATE_IDLE = 'idle'
@@ -74,7 +58,7 @@ MJPEG_START_HEADER = 'Content-type: {0}\r\n\r\n'
# pylint: disable=too-many-branches
def setup(hass, config):
""" Track states and offer events for sensors. """
""" Track states and offer events for cameras. """
component = EntityComponent(
logging.getLogger(__name__), DOMAIN, hass, SCAN_INTERVAL,
@@ -96,16 +80,21 @@ def setup(hass, config):
def _proxy_camera_image(handler, path_match, data):
""" Proxies the camera image via the HA server. """
entity_id = path_match.group(ATTR_ENTITY_ID)
camera = component.entities.get(entity_id)
camera = None
if entity_id in component.entities.keys():
camera = component.entities[entity_id]
if camera:
response = camera.camera_image()
handler.wfile.write(response)
else:
if camera is None:
handler.send_response(HTTP_NOT_FOUND)
handler.end_headers()
return
response = camera.camera_image()
if response is None:
handler.send_response(HTTP_NOT_FOUND)
handler.end_headers()
return
handler.wfile.write(response)
hass.http.register_path(
'GET',
@@ -114,18 +103,16 @@ def setup(hass, config):
# pylint: disable=unused-argument
def _proxy_camera_mjpeg_stream(handler, path_match, data):
""" Proxies the camera image as an mjpeg stream via the HA server.
"""
Proxies the camera image as an mjpeg stream via the HA server.
This function takes still images from the IP camera and turns them
into an MJPEG stream. This means that HA can return a live video
stream even with only a still image URL available.
"""
entity_id = path_match.group(ATTR_ENTITY_ID)
camera = component.entities.get(entity_id)
camera = None
if entity_id in component.entities.keys():
camera = component.entities[entity_id]
if not camera:
if camera is None:
handler.send_response(HTTP_NOT_FOUND)
handler.end_headers()
return
@@ -133,38 +120,12 @@ def setup(hass, config):
try:
camera.is_streaming = True
camera.update_ha_state()
handler.request.sendall(bytes('HTTP/1.1 200 OK\r\n', 'utf-8'))
handler.request.sendall(bytes(
'Content-type: multipart/x-mixed-replace; \
boundary=--jpgboundary\r\n\r\n', 'utf-8'))
handler.request.sendall(bytes('--jpgboundary\r\n', 'utf-8'))
# MJPEG_START_HEADER.format()
while True:
img_bytes = camera.camera_image()
headers_str = '\r\n'.join((
'Content-length: {}'.format(len(img_bytes)),
'Content-type: image/jpeg',
)) + '\r\n\r\n'
handler.request.sendall(
bytes(headers_str, 'utf-8') +
img_bytes +
bytes('\r\n', 'utf-8'))
handler.request.sendall(
bytes('--jpgboundary\r\n', 'utf-8'))
camera.mjpeg_stream(handler)
except (requests.RequestException, IOError):
camera.is_streaming = False
camera.update_ha_state()
camera.is_streaming = False
hass.http.register_path(
'GET',
re.compile(
@@ -175,7 +136,7 @@ def setup(hass, config):
class Camera(Entity):
""" The base class for camera components """
""" The base class for camera components. """
def __init__(self):
self.is_streaming = False
@@ -183,25 +144,53 @@ class Camera(Entity):
@property
# pylint: disable=no-self-use
def is_recording(self):
""" Returns true if the device is recording """
""" Returns true if the device is recording. """
return False
@property
# pylint: disable=no-self-use
def brand(self):
""" Should return a string of the camera brand """
""" Should return a string of the camera brand. """
return None
@property
# pylint: disable=no-self-use
def model(self):
""" Returns string of camera model """
""" Returns string of camera model. """
return None
def camera_image(self):
""" Return bytes of camera image """
""" Return bytes of camera image. """
raise NotImplementedError()
def mjpeg_stream(self, handler):
""" Generate an HTTP MJPEG stream from camera images. """
handler.request.sendall(bytes('HTTP/1.1 200 OK\r\n', 'utf-8'))
handler.request.sendall(bytes(
'Content-type: multipart/x-mixed-replace; \
boundary=--jpgboundary\r\n\r\n', 'utf-8'))
handler.request.sendall(bytes('--jpgboundary\r\n', 'utf-8'))
# MJPEG_START_HEADER.format()
while True:
img_bytes = self.camera_image()
if img_bytes is None:
continue
headers_str = '\r\n'.join((
'Content-length: {}'.format(len(img_bytes)),
'Content-type: image/jpeg',
)) + '\r\n\r\n'
handler.request.sendall(
bytes(headers_str, 'utf-8') +
img_bytes +
bytes('\r\n', 'utf-8'))
handler.request.sendall(
bytes('--jpgboundary\r\n', 'utf-8'))
time.sleep(0.5)
@property
def state(self):
""" Returns the state of the entity. """
@@ -0,0 +1,60 @@
"""
homeassistant.components.camera.bloomsky
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for a camera of a BloomSky weather station.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/camera.bloomsky/
"""
import logging
import requests
import homeassistant.components.bloomsky as bloomsky
from homeassistant.components.camera import Camera
DEPENDENCIES = ["bloomsky"]
# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
""" set up access to BloomSky cameras """
for device in bloomsky.BLOOMSKY.devices.values():
add_devices_callback([BloomSkyCamera(bloomsky.BLOOMSKY, device)])
class BloomSkyCamera(Camera):
""" Represents the images published from the BloomSky's camera. """
def __init__(self, bs, device):
""" set up for access to the BloomSky camera images """
super(BloomSkyCamera, self).__init__()
self._name = device["DeviceName"]
self._id = device["DeviceID"]
self._bloomsky = bs
self._url = ""
self._last_url = ""
# _last_image will store images as they are downloaded so that the
# frequent updates in home-assistant don't keep poking the server
# to download the same image over and over
self._last_image = ""
self._logger = logging.getLogger(__name__)
def camera_image(self):
""" Update the camera's image if it has changed. """
try:
self._url = self._bloomsky.devices[self._id]["Data"]["ImageURL"]
self._bloomsky.refresh_devices()
# if the url hasn't changed then the image hasn't changed
if self._url != self._last_url:
response = requests.get(self._url, timeout=10)
self._last_url = self._url
self._last_image = response.content
except requests.exceptions.RequestException as error:
self._logger.error("Error getting bloomsky image: %s", error)
return None
return self._last_image
@property
def name(self):
""" The name of this BloomSky device. """
return self._name
+37
View File
@@ -0,0 +1,37 @@
"""
homeassistant.components.camera.demo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo platform that has a fake camera.
"""
import os
from homeassistant.components.camera import Camera
import homeassistant.util.dt as dt_util
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Sets up the Demo camera. """
add_devices([
DemoCamera('Demo camera')
])
class DemoCamera(Camera):
""" A Demo camera. """
def __init__(self, name):
super().__init__()
self._name = name
def camera_image(self):
""" Return a faked still image response. """
now = dt_util.utcnow()
image_path = os.path.join(os.path.dirname(__file__),
'demo_{}.jpg'.format(now.second % 4))
with open(image_path, 'rb') as file:
return file.read()
@property
def name(self):
""" Return the name of this device. """
return self._name
Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

+61
View File
@@ -0,0 +1,61 @@
"""
homeassistant.components.camera.foscam
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This component provides basic support for Foscam IP cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.foscam/
"""
import logging
import requests
from homeassistant.helpers import validate_config
from homeassistant.components.camera import DOMAIN, Camera
_LOGGER = logging.getLogger(__name__)
# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
""" Adds a Foscam IP Camera. """
if not validate_config({DOMAIN: config},
{DOMAIN: ['username', 'password', 'ip']}, _LOGGER):
return None
add_devices_callback([FoscamCamera(config)])
# pylint: disable=too-many-instance-attributes
class FoscamCamera(Camera):
""" An implementation of a Foscam IP camera. """
def __init__(self, device_info):
super(FoscamCamera, self).__init__()
ip_address = device_info.get('ip')
port = device_info.get('port', 88)
self._base_url = 'http://' + ip_address + ':' + str(port) + '/'
self._username = device_info.get('username')
self._password = device_info.get('password')
self._snap_picture_url = self._base_url \
+ 'cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=' \
+ self._username + '&pwd=' + self._password
self._name = device_info.get('name', 'Foscam Camera')
_LOGGER.info('Using the following URL for %s: %s',
self._name, self._snap_picture_url)
def camera_image(self):
""" Return a still image reponse from the camera. """
# Send the request to snap a picture and return raw jpg data
response = requests.get(self._snap_picture_url)
return response.content
@property
def name(self):
""" Return the name of this device. """
return self._name
+20 -46
View File
@@ -3,50 +3,16 @@ homeassistant.components.camera.generic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for IP Cameras.
This component provides basic support for IP cameras. For the basic support to
work you camera must support accessing a JPEG snapshot via a URL and you will
need to specify the "still_image_url" parameter which should be the location of
the JPEG image.
As part of the basic support the following features will be provided:
- MJPEG video streaming
- Saving a snapshot
- Recording(JPEG frame capture)
To use this component, add the following to your configuration.yaml file.
camera:
platform: generic
name: Door Camera
username: YOUR_USERNAME
password: YOUR_PASSWORD
still_image_url: http://YOUR_CAMERA_IP_AND_PORT/image.jpg
Variables:
still_image_url
*Required
The URL your camera serves the image on, eg. http://192.168.1.21:2112/
name
*Optional
This parameter allows you to override the name of your camera in Home
Assistant.
username
*Optional
The username for accessing your camera.
password
*Optional
The password for accessing your camera.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.generic/
"""
import logging
from requests.auth import HTTPBasicAuth
from homeassistant.helpers import validate_config
from homeassistant.components.camera import DOMAIN
from homeassistant.components.camera import Camera
import requests
from requests.auth import HTTPBasicAuth
from homeassistant.helpers import validate_config
from homeassistant.components.camera import DOMAIN, Camera
_LOGGER = logging.getLogger(__name__)
@@ -75,13 +41,21 @@ class GenericCamera(Camera):
self._still_image_url = device_info['still_image_url']
def camera_image(self):
""" Return a still image reponse from the camera. """
""" Return a still image response from the camera. """
if self._username and self._password:
response = requests.get(
self._still_image_url,
auth=HTTPBasicAuth(self._username, self._password))
try:
response = requests.get(
self._still_image_url,
auth=HTTPBasicAuth(self._username, self._password))
except requests.exceptions.RequestException as error:
_LOGGER.error('Error getting camera image: %s', error)
return None
else:
response = requests.get(self._still_image_url)
try:
response = requests.get(self._still_image_url)
except requests.exceptions.RequestException as error:
_LOGGER.error('Error getting camera image: %s', error)
return None
return response.content
+92
View File
@@ -0,0 +1,92 @@
"""
homeassistant.components.camera.mjpeg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for IP Cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.mjpeg/
"""
from contextlib import closing
import logging
import requests
from requests.auth import HTTPBasicAuth
from homeassistant.helpers import validate_config
from homeassistant.components.camera import DOMAIN, Camera
from homeassistant.const import HTTP_OK
CONTENT_TYPE_HEADER = 'Content-Type'
_LOGGER = logging.getLogger(__name__)
# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
""" Adds a mjpeg IP Camera. """
if not validate_config({DOMAIN: config}, {DOMAIN: ['mjpeg_url']},
_LOGGER):
return None
add_devices_callback([MjpegCamera(config)])
# pylint: disable=too-many-instance-attributes
class MjpegCamera(Camera):
"""
A generic implementation of an IP camera that is reachable over a URL.
"""
def __init__(self, device_info):
super().__init__()
self._name = device_info.get('name', 'Mjpeg Camera')
self._username = device_info.get('username')
self._password = device_info.get('password')
self._mjpeg_url = device_info['mjpeg_url']
def camera_stream(self):
""" Return a mjpeg stream image response directly from the camera. """
if self._username and self._password:
return requests.get(self._mjpeg_url,
auth=HTTPBasicAuth(self._username,
self._password),
stream=True)
else:
return requests.get(self._mjpeg_url,
stream=True)
def camera_image(self):
""" Return a still image response from the camera. """
def process_response(response):
""" Take in a response object, return the jpg from it. """
data = b''
for chunk in response.iter_content(1024):
data += chunk
jpg_start = data.find(b'\xff\xd8')
jpg_end = data.find(b'\xff\xd9')
if jpg_start != -1 and jpg_end != -1:
jpg = data[jpg_start:jpg_end + 2]
return jpg
with closing(self.camera_stream()) as response:
return process_response(response)
def mjpeg_stream(self, handler):
""" Generate an HTTP MJPEG stream from the camera. """
response = self.camera_stream()
content_type = response.headers[CONTENT_TYPE_HEADER]
handler.send_response(HTTP_OK)
handler.send_header(CONTENT_TYPE_HEADER, content_type)
handler.end_headers()
for chunk in response.iter_content(chunk_size=1024):
if not chunk:
break
handler.wfile.write(chunk)
@property
def name(self):
""" Return the name of this device. """
return self._name
+91
View File
@@ -0,0 +1,91 @@
"""
homeassistant.components.camera.uvc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for Ubiquiti's UVC cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.uvc/
"""
import logging
import socket
import requests
from homeassistant.helpers import validate_config
from homeassistant.components.camera import DOMAIN, Camera
REQUIREMENTS = ['uvcclient==0.5']
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_devices, discovery_info=None):
""" Discover cameras on a Unifi NVR. """
if not validate_config({DOMAIN: config}, {DOMAIN: ['nvr', 'key']},
_LOGGER):
return None
addr = config.get('nvr')
port = int(config.get('port', 7080))
key = config.get('key')
from uvcclient import nvr
nvrconn = nvr.UVCRemote(addr, port, key)
try:
cameras = nvrconn.index()
except nvr.NotAuthorized:
_LOGGER.error('Authorization failure while connecting to NVR')
return False
except nvr.NvrError:
_LOGGER.error('NVR refuses to talk to me')
return False
except requests.exceptions.ConnectionError as ex:
_LOGGER.error('Unable to connect to NVR: %s', str(ex))
return False
for camera in cameras:
add_devices([UnifiVideoCamera(nvrconn,
camera['uuid'],
camera['name'])])
class UnifiVideoCamera(Camera):
""" A Ubiquiti Unifi Video Camera. """
def __init__(self, nvr, uuid, name):
super(UnifiVideoCamera, self).__init__()
self._nvr = nvr
self._uuid = uuid
self._name = name
self.is_streaming = False
@property
def name(self):
return self._name
@property
def is_recording(self):
caminfo = self._nvr.get_camera(self._uuid)
return caminfo['recordingSettings']['fullTimeRecordEnabled']
def camera_image(self):
from uvcclient import camera as uvc_camera
caminfo = self._nvr.get_camera(self._uuid)
camera = None
for addr in [caminfo['host'], caminfo['internalHost']]:
try:
camera = uvc_camera.UVCCameraClient(addr,
caminfo['username'],
'ubnt')
_LOGGER.debug('Logged into UVC camera %(name)s via %(addr)s',
dict(name=self._name, addr=addr))
except socket.error:
pass
if not camera:
_LOGGER.error('Unable to login to camera')
return None
camera.login()
return camera.get_snapshot()
+2 -3
View File
@@ -11,11 +11,10 @@ the user has submitted configuration information.
"""
import logging
from homeassistant.helpers import generate_entity_id
from homeassistant.helpers.entity import generate_entity_id
from homeassistant.const import EVENT_TIME_CHANGED
DOMAIN = "configurator"
DEPENDENCIES = []
ENTITY_ID_FORMAT = DOMAIN + ".{}"
SERVICE_CONFIGURE = "configure"
@@ -142,7 +141,7 @@ class Configurator(object):
state = self.hass.states.get(entity_id)
new_data = state.attributes
new_data = dict(state.attributes)
new_data[ATTR_ERRORS] = error
self.hass.states.set(entity_id, STATE_CONFIGURE, new_data)
+13 -6
View File
@@ -1,19 +1,20 @@
"""
homeassistant.components.conversation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to have conversations with Home Assistant.
This is more a proof of concept.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/conversation/
"""
import logging
import re
from homeassistant import core
from homeassistant.const import (
ATTR_ENTITY_ID, SERVICE_TURN_ON, SERVICE_TURN_OFF)
DOMAIN = "conversation"
DEPENDENCIES = []
SERVICE_PROCESS = "process"
@@ -21,9 +22,13 @@ ATTR_TEXT = "text"
REGEX_TURN_COMMAND = re.compile(r'turn (?P<name>(?: |\w)+) (?P<command>\w+)')
REQUIREMENTS = ['fuzzywuzzy==0.8.0']
def setup(hass, config):
""" Registers the process service. """
from fuzzywuzzy import process as fuzzyExtract
logger = logging.getLogger(__name__)
def process(service):
@@ -42,9 +47,11 @@ def setup(hass, config):
name, command = match.groups()
entity_ids = [
state.entity_id for state in hass.states.all()
if state.name.lower() == name]
entities = {state.entity_id: state.name for state in hass.states.all()}
entity_ids = fuzzyExtract.extractOne(name,
entities,
score_cutoff=65)[2]
if not entity_ids:
logger.error(
+31 -37
View File
@@ -10,14 +10,27 @@ import homeassistant.core as ha
import homeassistant.bootstrap as bootstrap
import homeassistant.loader as loader
from homeassistant.const import (
CONF_PLATFORM, ATTR_ENTITY_PICTURE, ATTR_ENTITY_ID, ATTR_FRIENDLY_NAME)
CONF_PLATFORM, ATTR_ENTITY_ID)
DOMAIN = "demo"
DEPENDENCIES = ['introduction', 'conversation']
DEPENDENCIES = ['conversation', 'introduction', 'zone']
COMPONENTS_WITH_DEMO_PLATFORM = [
'switch', 'light', 'thermostat', 'sensor', 'media_player', 'notify']
'alarm_control_panel',
'binary_sensor',
'camera',
'device_tracker',
'garage_door',
'light',
'lock',
'media_player',
'notify',
'rollershutter',
'sensor',
'switch',
'thermostat',
]
def setup(hass, config):
@@ -33,35 +46,33 @@ def setup(hass, config):
# Setup sun
if not hass.config.latitude:
hass.config.latitude = '32.87336'
hass.config.latitude = 32.87336
if not hass.config.longitude:
hass.config.longitude = '117.22743'
hass.config.longitude = 117.22743
bootstrap.setup_component(hass, 'sun')
# Setup demo platforms
demo_config = config.copy()
for component in COMPONENTS_WITH_DEMO_PLATFORM:
bootstrap.setup_component(
hass, component, {component: {CONF_PLATFORM: 'demo'}})
demo_config[component] = {CONF_PLATFORM: 'demo'}
bootstrap.setup_component(hass, component, demo_config)
# Setup room groups
lights = sorted(hass.states.entity_ids('light'))
switches = sorted(hass.states.entity_ids('switch'))
media_players = sorted(hass.states.entity_ids('media_player'))
group.setup_group(hass, 'living room', [lights[2], lights[1], switches[0],
media_players[1]])
group.setup_group(hass, 'bedroom', [lights[0], switches[1],
media_players[0]])
# Setup IP Camera
bootstrap.setup_component(
hass, 'camera',
{'camera': {
'platform': 'generic',
'name': 'IP Camera',
'still_image_url': 'http://194.218.96.92/jpg/image.jpg',
}})
group.Group(hass, 'living room', [
lights[2], lights[1], switches[0], media_players[1],
'scene.romantic_lights'])
group.Group(hass, 'bedroom', [lights[0], switches[1],
media_players[0]])
group.Group(hass, 'Rooms', [
'group.living_room', 'group.bedroom',
'scene.romantic_lights', 'rollershutter.kitchen_window',
'rollershutter.living_room_window',
], view=True)
# Setup scripts
bootstrap.setup_component(
@@ -102,23 +113,6 @@ def setup(hass, config):
}},
]})
# Setup fake device tracker
hass.states.set("device_tracker.paulus", "home",
{ATTR_ENTITY_PICTURE:
"http://graph.facebook.com/297400035/picture",
ATTR_FRIENDLY_NAME: 'Paulus'})
hass.states.set("device_tracker.anne_therese", "not_home",
{ATTR_FRIENDLY_NAME: 'Anne Therese'})
hass.states.set("group.all_devices", "home",
{
"auto": True,
ATTR_ENTITY_ID: [
"device_tracker.paulus",
"device_tracker.anne_therese"
]
})
# Setup configurator
configurator_ids = []
@@ -1,9 +1,11 @@
"""
homeassistant.components.device_sun_light_trigger
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to turn on lights based on the state of the sun and
devices.
Provides functionality to turn on lights based on
the state of the sun and devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/device_sun_light_trigger/
"""
import logging
from datetime import timedelta
@@ -1,52 +1,75 @@
"""
homeassistant.components.tracker
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
homeassistant.components.device_tracker
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to keep track of devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/device_tracker/
"""
import logging
import threading
import os
# pylint: disable=too-many-instance-attributes, too-many-arguments
# pylint: disable=too-many-locals
import csv
from datetime import timedelta
import logging
import os
import threading
from homeassistant.helpers import validate_config
from homeassistant.helpers.entity import _OVERWRITE
from homeassistant.bootstrap import prepare_setup_platform
from homeassistant.components import discovery, group, zone
from homeassistant.config import load_yaml_config_file
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_per_platform
from homeassistant.helpers.entity import Entity
import homeassistant.util as util
import homeassistant.util.dt as dt_util
from homeassistant.bootstrap import prepare_setup_platform
from homeassistant.helpers.event import track_utc_time_change
from homeassistant.const import (
STATE_HOME, STATE_NOT_HOME, ATTR_ENTITY_PICTURE, ATTR_FRIENDLY_NAME,
CONF_PLATFORM, DEVICE_DEFAULT_NAME)
from homeassistant.components import group
ATTR_ENTITY_PICTURE, ATTR_GPS_ACCURACY, ATTR_LATITUDE, ATTR_LONGITUDE,
DEVICE_DEFAULT_NAME, STATE_HOME, STATE_NOT_HOME)
DOMAIN = "device_tracker"
DEPENDENCIES = []
SERVICE_DEVICE_TRACKER_RELOAD = "reload_devices_csv"
DEPENDENCIES = ['zone']
GROUP_NAME_ALL_DEVICES = 'all devices'
ENTITY_ID_ALL_DEVICES = group.ENTITY_ID_FORMAT.format('all_devices')
ENTITY_ID_FORMAT = DOMAIN + '.{}'
# After how much time do we consider a device not home if
# it does not show up on scans
TIME_DEVICE_NOT_FOUND = timedelta(minutes=3)
CSV_DEVICES = "known_devices.csv"
YAML_DEVICES = 'known_devices.yaml'
# Filename to save known devices to
KNOWN_DEVICES_FILE = "known_devices.csv"
CONF_TRACK_NEW = "track_new_devices"
DEFAULT_CONF_TRACK_NEW = True
CONF_SECONDS = "interval_seconds"
CONF_CONSIDER_HOME = 'consider_home'
DEFAULT_CONSIDER_HOME = 180 # seconds
DEFAULT_CONF_SECONDS = 12
CONF_SCAN_INTERVAL = "interval_seconds"
DEFAULT_SCAN_INTERVAL = 12
TRACK_NEW_DEVICES = "track_new_devices"
CONF_AWAY_HIDE = 'hide_if_away'
DEFAULT_AWAY_HIDE = False
CONF_HOME_RANGE = 'home_range'
DEFAULT_HOME_RANGE = 100
SERVICE_SEE = 'see'
ATTR_MAC = 'mac'
ATTR_DEV_ID = 'dev_id'
ATTR_HOST_NAME = 'host_name'
ATTR_LOCATION_NAME = 'location_name'
ATTR_GPS = 'gps'
ATTR_BATTERY = 'battery'
DISCOVERY_PLATFORMS = {
discovery.SERVICE_NETGEAR: 'netgear',
}
_LOGGER = logging.getLogger(__name__)
# pylint: disable=too-many-arguments
def is_on(hass, entity_id=None):
""" Returns if any or specified device is home. """
@@ -55,293 +78,356 @@ def is_on(hass, entity_id=None):
return hass.states.is_state(entity, STATE_HOME)
def see(hass, mac=None, dev_id=None, host_name=None, location_name=None,
gps=None, gps_accuracy=None, battery=None):
""" Call service to notify you see device. """
data = {key: value for key, value in
((ATTR_MAC, mac),
(ATTR_DEV_ID, dev_id),
(ATTR_HOST_NAME, host_name),
(ATTR_LOCATION_NAME, location_name),
(ATTR_GPS, gps)) if value is not None}
hass.services.call(DOMAIN, SERVICE_SEE, data)
def setup(hass, config):
""" Sets up the device tracker. """
""" Setup device tracker """
yaml_path = hass.config.path(YAML_DEVICES)
csv_path = hass.config.path(CSV_DEVICES)
if os.path.isfile(csv_path) and not os.path.isfile(yaml_path) and \
convert_csv_config(csv_path, yaml_path):
os.remove(csv_path)
if not validate_config(config, {DOMAIN: [CONF_PLATFORM]}, _LOGGER):
return False
conf = config.get(DOMAIN, {})
if isinstance(conf, list):
conf = conf[0]
consider_home = timedelta(
seconds=util.convert(conf.get(CONF_CONSIDER_HOME), int,
DEFAULT_CONSIDER_HOME))
track_new = util.convert(conf.get(CONF_TRACK_NEW), bool,
DEFAULT_CONF_TRACK_NEW)
home_range = util.convert(conf.get(CONF_HOME_RANGE), int,
DEFAULT_HOME_RANGE)
tracker_type = config[DOMAIN].get(CONF_PLATFORM)
devices = load_config(yaml_path, hass, consider_home, home_range)
tracker = DeviceTracker(hass, consider_home, track_new, home_range,
devices)
tracker_implementation = \
prepare_setup_platform(hass, config, DOMAIN, tracker_type)
if tracker_implementation is None:
_LOGGER.error("Unknown device_tracker type specified: %s.",
tracker_type)
return False
device_scanner = tracker_implementation.get_scanner(hass, config)
if device_scanner is None:
_LOGGER.error("Failed to initialize device scanner: %s",
tracker_type)
return False
seconds = util.convert(config[DOMAIN].get(CONF_SECONDS), int,
DEFAULT_CONF_SECONDS)
track_new_devices = config[DOMAIN].get(TRACK_NEW_DEVICES) or False
_LOGGER.info("Tracking new devices: %s", track_new_devices)
tracker = DeviceTracker(hass, device_scanner, seconds, track_new_devices)
# We only succeeded if we got to parse the known devices file
return not tracker.invalid_known_devices_file
class DeviceTracker(object):
""" Class that tracks which devices are home and which are not. """
def __init__(self, hass, device_scanner, seconds, track_new_devices):
self.hass = hass
self.device_scanner = device_scanner
self.lock = threading.Lock()
# Do we track new devices by default?
self.track_new_devices = track_new_devices
# Dictionary to keep track of known devices and devices we track
self.tracked = {}
self.untracked_devices = set()
# Did we encounter an invalid known devices file
self.invalid_known_devices_file = False
# Wrap it in a func instead of lambda so it can be identified in
# the bus by its __name__ attribute.
def update_device_state(now):
""" Triggers update of the device states. """
self.update_devices(now)
dev_group = group.Group(
hass, GROUP_NAME_ALL_DEVICES, user_defined=False)
def reload_known_devices_service(service):
""" Reload known devices file. """
self._read_known_devices_file()
self.update_devices(dt_util.utcnow())
dev_group.update_tracked_entity_ids(self.device_entity_ids)
reload_known_devices_service(None)
if self.invalid_known_devices_file:
return
seconds = range(0, 60, seconds)
_LOGGER.info("Device tracker interval second=%s", seconds)
track_utc_time_change(hass, update_device_state, second=seconds)
hass.services.register(DOMAIN,
SERVICE_DEVICE_TRACKER_RELOAD,
reload_known_devices_service)
@property
def device_entity_ids(self):
""" Returns a set containing all device entity ids
that are being tracked. """
return set(device['entity_id'] for device in self.tracked.values())
def _update_state(self, now, device, is_home):
""" Update the state of a device. """
dev_info = self.tracked[device]
if is_home:
# Update last seen if at home
dev_info['last_seen'] = now
else:
# State remains at home if it has been seen in the last
# TIME_DEVICE_NOT_FOUND
is_home = now - dev_info['last_seen'] < TIME_DEVICE_NOT_FOUND
state = STATE_HOME if is_home else STATE_NOT_HOME
# overwrite properties that have been set in the config file
attr = dict(dev_info['state_attr'])
attr.update(_OVERWRITE.get(dev_info['entity_id'], {}))
self.hass.states.set(
dev_info['entity_id'], state, attr)
def update_devices(self, now):
""" Update device states based on the found devices. """
if not self.lock.acquire(False):
def setup_platform(p_type, p_config, disc_info=None):
""" Setup a device tracker platform. """
platform = prepare_setup_platform(hass, config, DOMAIN, p_type)
if platform is None:
return
try:
found_devices = set(dev.upper() for dev in
self.device_scanner.scan_devices())
if hasattr(platform, 'get_scanner'):
scanner = platform.get_scanner(hass, {DOMAIN: p_config})
for device in self.tracked:
is_home = device in found_devices
if scanner is None:
_LOGGER.error('Error setting up platform %s', p_type)
return
self._update_state(now, device, is_home)
setup_scanner_platform(hass, p_config, scanner, tracker.see)
return
if is_home:
found_devices.remove(device)
if not platform.setup_scanner(hass, p_config, tracker.see):
_LOGGER.error('Error setting up platform %s', p_type)
except Exception: # pylint: disable=broad-except
_LOGGER.exception('Error setting up platform %s', p_type)
# Did we find any devices that we didn't know about yet?
new_devices = found_devices - self.untracked_devices
for p_type, p_config in \
config_per_platform(config, DOMAIN, _LOGGER):
setup_platform(p_type, p_config)
if new_devices:
if not self.track_new_devices:
self.untracked_devices.update(new_devices)
def device_tracker_discovered(service, info):
""" Called when a device tracker platform is discovered. """
setup_platform(DISCOVERY_PLATFORMS[service], {}, info)
self._update_known_devices_file(new_devices)
finally:
self.lock.release()
discovery.listen(hass, DISCOVERY_PLATFORMS.keys(),
device_tracker_discovered)
# pylint: disable=too-many-branches
def _read_known_devices_file(self):
""" Parse and process the known devices file. """
known_dev_path = self.hass.config.path(KNOWN_DEVICES_FILE)
def update_stale(now):
""" Clean up stale devices. """
tracker.update_stale(now)
track_utc_time_change(hass, update_stale, second=range(0, 60, 5))
# Return if no known devices file exists
if not os.path.isfile(known_dev_path):
tracker.setup_group()
def see_service(call):
""" Service to see a device. """
args = {key: value for key, value in call.data.items() if key in
(ATTR_MAC, ATTR_DEV_ID, ATTR_HOST_NAME, ATTR_LOCATION_NAME,
ATTR_GPS, ATTR_GPS_ACCURACY, ATTR_BATTERY)}
tracker.see(**args)
descriptions = load_yaml_config_file(
os.path.join(os.path.dirname(__file__), 'services.yaml'))
hass.services.register(DOMAIN, SERVICE_SEE, see_service,
descriptions.get(SERVICE_SEE))
return True
class DeviceTracker(object):
""" Track devices """
def __init__(self, hass, consider_home, track_new, home_range, devices):
self.hass = hass
self.devices = {dev.dev_id: dev for dev in devices}
self.mac_to_dev = {dev.mac: dev for dev in devices if dev.mac}
self.consider_home = consider_home
self.track_new = track_new
self.home_range = home_range
self.lock = threading.Lock()
for device in devices:
if device.track:
device.update_ha_state()
self.group = None
def see(self, mac=None, dev_id=None, host_name=None, location_name=None,
gps=None, gps_accuracy=None, battery=None):
""" Notify device tracker that you see a device. """
with self.lock:
if mac is None and dev_id is None:
raise HomeAssistantError('Neither mac or device id passed in')
elif mac is not None:
mac = mac.upper()
device = self.mac_to_dev.get(mac)
if not device:
dev_id = util.slugify(host_name or '') or util.slugify(mac)
else:
dev_id = str(dev_id).lower()
device = self.devices.get(dev_id)
if device:
device.seen(host_name, location_name, gps, gps_accuracy,
battery)
if device.track:
device.update_ha_state()
return
# If no device can be found, create it
device = Device(
self.hass, self.consider_home, self.home_range, self.track_new,
dev_id, mac, (host_name or dev_id).replace('_', ' '))
self.devices[dev_id] = device
if mac is not None:
self.mac_to_dev[mac] = device
device.seen(host_name, location_name, gps, gps_accuracy, battery)
if device.track:
device.update_ha_state()
# During init, we ignore the group
if self.group is not None:
self.group.update_tracked_entity_ids(
list(self.group.tracking) + [device.entity_id])
update_config(self.hass.config.path(YAML_DEVICES), dev_id, device)
def setup_group(self):
""" Initializes group for all tracked devices. """
entity_ids = (dev.entity_id for dev in self.devices.values()
if dev.track)
self.group = group.Group(
self.hass, GROUP_NAME_ALL_DEVICES, entity_ids, False)
def update_stale(self, now):
""" Update stale devices. """
with self.lock:
for device in self.devices.values():
if (device.track and device.last_update_home and
device.stale(now)):
device.update_ha_state(True)
class Device(Entity):
""" Tracked device. """
host_name = None
location_name = None
gps = None
gps_accuracy = 0
last_seen = None
battery = None
# Track if the last update of this device was HOME
last_update_home = False
_state = STATE_NOT_HOME
def __init__(self, hass, consider_home, home_range, track, dev_id, mac,
name=None, picture=None, away_hide=False):
self.hass = hass
self.entity_id = ENTITY_ID_FORMAT.format(dev_id)
# Timedelta object how long we consider a device home if it is not
# detected anymore.
self.consider_home = consider_home
# Distance in meters
self.home_range = home_range
# Device ID
self.dev_id = dev_id
self.mac = mac
# If we should track this device
self.track = track
# Configured name
self.config_name = name
# Configured picture
self.config_picture = picture
self.away_hide = away_hide
@property
def gps_home(self):
""" Return if device is within range of home. """
distance = max(
0, self.hass.config.distance(*self.gps) - self.gps_accuracy)
return self.gps is not None and distance <= self.home_range
@property
def name(self):
""" Returns the name of the entity. """
return self.config_name or self.host_name or DEVICE_DEFAULT_NAME
@property
def state(self):
""" State of the device. """
return self._state
@property
def state_attributes(self):
""" Device state attributes. """
attr = {}
if self.config_picture:
attr[ATTR_ENTITY_PICTURE] = self.config_picture
if self.gps:
attr[ATTR_LATITUDE] = self.gps[0]
attr[ATTR_LONGITUDE] = self.gps[1]
attr[ATTR_GPS_ACCURACY] = self.gps_accuracy
if self.battery:
attr[ATTR_BATTERY] = self.battery
return attr
@property
def hidden(self):
""" If device should be hidden. """
return self.away_hide and self.state != STATE_HOME
def seen(self, host_name=None, location_name=None, gps=None,
gps_accuracy=0, battery=None):
""" Mark the device as seen. """
self.last_seen = dt_util.utcnow()
self.host_name = host_name
self.location_name = location_name
self.gps_accuracy = gps_accuracy or 0
self.battery = battery
if gps is None:
self.gps = None
else:
try:
self.gps = tuple(float(val) for val in gps)
except ValueError:
_LOGGER.warning('Could not parse gps value for %s: %s',
self.dev_id, gps)
self.gps = None
self.update()
def stale(self, now=None):
""" Return if device state is stale. """
return self.last_seen and \
(now or dt_util.utcnow()) - self.last_seen > self.consider_home
def update(self):
""" Update state of entity. """
if not self.last_seen:
return
elif self.location_name:
self._state = self.location_name
elif self.gps is not None:
zone_state = zone.active_zone(self.hass, self.gps[0], self.gps[1],
self.gps_accuracy)
if zone_state is None:
self._state = STATE_NOT_HOME
elif zone_state.entity_id == zone.ENTITY_ID_HOME:
self._state = STATE_HOME
else:
self._state = zone_state.name
self.lock.acquire()
elif self.stale():
self._state = STATE_NOT_HOME
self.last_update_home = False
else:
self._state = STATE_HOME
self.last_update_home = True
self.untracked_devices.clear()
with open(known_dev_path) as inp:
def convert_csv_config(csv_path, yaml_path):
""" Convert CSV config file format to YAML. """
used_ids = set()
with open(csv_path) as inp:
for row in csv.DictReader(inp):
dev_id = util.ensure_unique_string(
(util.slugify(row['name']) or DEVICE_DEFAULT_NAME).lower(),
used_ids)
used_ids.add(dev_id)
device = Device(None, None, None, row['track'] == '1', dev_id,
row['device'], row['name'], row['picture'])
update_config(yaml_path, dev_id, device)
return True
# To track which devices need an entity_id assigned
need_entity_id = []
# All devices that are still in this set after we read the CSV file
# have been removed from the file and thus need to be cleaned up.
removed_devices = set(self.tracked.keys())
def load_config(path, hass, consider_home, home_range):
""" Load devices from YAML config file. """
if not os.path.isfile(path):
return []
return [
Device(hass, consider_home, home_range, device.get('track', False),
str(dev_id).lower(), str(device.get('mac')).upper(),
device.get('name'), device.get('picture'),
device.get(CONF_AWAY_HIDE, DEFAULT_AWAY_HIDE))
for dev_id, device in load_yaml_config_file(path).items()]
try:
for row in csv.DictReader(inp):
device = row['device'].upper()
if row['track'] == '1':
if device in self.tracked:
# Device exists
removed_devices.remove(device)
else:
# We found a new device
need_entity_id.append(device)
def setup_scanner_platform(hass, config, scanner, see_device):
""" Helper method to connect scanner-based platform to device tracker. """
interval = util.convert(config.get(CONF_SCAN_INTERVAL), int,
DEFAULT_SCAN_INTERVAL)
self._track_device(device, row['name'])
# Initial scan of each mac we also tell about host name for config
seen = set()
# Update state_attr with latest from file
state_attr = {
ATTR_FRIENDLY_NAME: row['name']
}
def device_tracker_scan(now):
""" Called when interval matches. """
for mac in scanner.scan_devices():
if mac in seen:
host_name = None
else:
host_name = scanner.get_device_name(mac)
seen.add(mac)
see_device(mac=mac, host_name=host_name)
if row['picture']:
state_attr[ATTR_ENTITY_PICTURE] = row['picture']
track_utc_time_change(hass, device_tracker_scan, second=range(0, 60,
interval))
self.tracked[device]['state_attr'] = state_attr
device_tracker_scan(None)
else:
self.untracked_devices.add(device)
# Remove existing devices that we no longer track
for device in removed_devices:
entity_id = self.tracked[device]['entity_id']
def update_config(path, dev_id, device):
""" Add device to YAML config file. """
with open(path, 'a') as out:
out.write('\n')
out.write('{}:\n'.format(device.dev_id))
_LOGGER.info("Removing entity %s", entity_id)
self.hass.states.remove(entity_id)
self.tracked.pop(device)
self._generate_entity_ids(need_entity_id)
if not self.tracked:
_LOGGER.warning(
"No devices to track. Please update %s.",
known_dev_path)
_LOGGER.info("Loaded devices from %s", known_dev_path)
except KeyError:
self.invalid_known_devices_file = True
_LOGGER.warning(
("Invalid known devices file: %s. "
"We won't update it with new found devices."),
known_dev_path)
finally:
self.lock.release()
def _update_known_devices_file(self, new_devices):
""" Add new devices to known devices file. """
if not self.invalid_known_devices_file:
known_dev_path = self.hass.config.path(KNOWN_DEVICES_FILE)
try:
# If file does not exist we will write the header too
is_new_file = not os.path.isfile(known_dev_path)
with open(known_dev_path, 'a') as outp:
_LOGGER.info("Found %d new devices, updating %s",
len(new_devices), known_dev_path)
writer = csv.writer(outp)
if is_new_file:
writer.writerow(("device", "name", "track", "picture"))
for device in new_devices:
# See if the device scanner knows the name
# else defaults to unknown device
name = self.device_scanner.get_device_name(device) or \
DEVICE_DEFAULT_NAME
track = 0
if self.track_new_devices:
self._track_device(device, name)
track = 1
writer.writerow((device, name, track, ""))
if self.track_new_devices:
self._generate_entity_ids(new_devices)
except IOError:
_LOGGER.exception("Error updating %s with %d new devices",
known_dev_path, len(new_devices))
def _track_device(self, device, name):
"""
Add a device to the list of tracked devices.
Does not generate the entity id yet.
"""
default_last_seen = dt_util.utcnow().replace(year=1990)
self.tracked[device] = {
'name': name,
'last_seen': default_last_seen,
'state_attr': {ATTR_FRIENDLY_NAME: name}
}
def _generate_entity_ids(self, need_entity_id):
""" Generate entity ids for a list of devices. """
# Setup entity_ids for the new devices
used_entity_ids = [info['entity_id'] for device, info
in self.tracked.items()
if device not in need_entity_id]
for device in need_entity_id:
name = self.tracked[device]['name']
entity_id = util.ensure_unique_string(
ENTITY_ID_FORMAT.format(util.slugify(name)),
used_entity_ids)
used_entity_ids.append(entity_id)
self.tracked[device]['entity_id'] = entity_id
for key, value in (('name', device.name), ('mac', device.mac),
('picture', device.config_picture),
('track', 'yes' if device.track else 'no'),
(CONF_AWAY_HIDE,
'yes' if device.away_hide else 'no')):
out.write(' {}: {}\n'.format(key, '' if value is None else value))
@@ -4,41 +4,8 @@ homeassistant.components.device_tracker.actiontec
Device tracker platform that supports scanning an Actiontec MI424WR
(Verizon FIOS) router for device presence.
This device tracker needs telnet to be enabled on the router.
Configuration:
To use the Actiontec tracker you will need to add something like the
following to your configuration.yaml file. If you experience disconnects
you can modify the home_interval variable.
device_tracker:
platform: actiontec
host: YOUR_ROUTER_IP
username: YOUR_ADMIN_USERNAME
password: YOUR_ADMIN_PASSWORD
# optional:
home_interval: 10
Variables:
host
*Required
The IP address of your router, e.g. 192.168.1.1.
username
*Required
The username of an user with administrative privileges, usually 'admin'.
password
*Required
The password for your given admin account.
home_interval
*Optional
If the home_interval is set then the component will not let a device
be AWAY if it has been HOME in the last home_interval minutes. This is
in addition to the 3 minute wait built into the device_tracker component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.actiontec/
"""
import logging
from datetime import timedelta
@@ -50,20 +17,19 @@ import telnetlib
import homeassistant.util.dt as dt_util
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
from homeassistant.helpers import validate_config
from homeassistant.util import Throttle, convert
from homeassistant.util import Throttle
from homeassistant.components.device_tracker import DOMAIN
# Return cached results if last scan was less then this time ago
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
# interval in minutes to exclude devices from a scan while they are home
CONF_HOME_INTERVAL = "home_interval"
_LOGGER = logging.getLogger(__name__)
_LEASES_REGEX = re.compile(
r'(?P<ip>([0-9]{1,3}[\.]){3}[0-9]{1,3})' +
r'\smac:\s(?P<mac>([0-9a-f]{2}[:-]){5}([0-9a-f]{2}))')
r'\smac:\s(?P<mac>([0-9a-f]{2}[:-]){5}([0-9a-f]{2}))' +
r'\svalid\sfor:\s(?P<timevalid>(-?\d+))' +
r'\ssec')
# pylint: disable=unused-argument
@@ -73,9 +39,7 @@ def get_scanner(hass, config):
{DOMAIN: [CONF_HOST, CONF_USERNAME, CONF_PASSWORD]},
_LOGGER):
return None
scanner = ActiontecDeviceScanner(config[DOMAIN])
return scanner if scanner.success_init else None
Device = namedtuple("Device", ["mac", "ip", "last_update"])
@@ -91,19 +55,11 @@ class ActiontecDeviceScanner(object):
self.host = config[CONF_HOST]
self.username = config[CONF_USERNAME]
self.password = config[CONF_PASSWORD]
minutes = convert(config.get(CONF_HOME_INTERVAL), int, 0)
self.home_interval = timedelta(minutes=minutes)
self.lock = threading.Lock()
self.last_results = []
# Test the router is accessible
data = self.get_actiontec_data()
self.success_init = data is not None
_LOGGER.info("actiontec scanner initialized")
if self.home_interval:
_LOGGER.info("home_interval set to: %s", self.home_interval)
def scan_devices(self):
"""
@@ -133,27 +89,13 @@ class ActiontecDeviceScanner(object):
return False
with self.lock:
exclude_targets = set()
exclude_target_list = []
now = dt_util.now()
if self.home_interval:
for host in self.last_results:
if host.last_update + self.home_interval > now:
exclude_targets.add(host)
if len(exclude_targets) > 0:
exclude_target_list = [t.ip for t in exclude_targets]
actiontec_data = self.get_actiontec_data()
if not actiontec_data:
return False
self.last_results = []
for client in exclude_target_list:
if client in actiontec_data:
actiontec_data.pop(client)
for name, data in actiontec_data.items():
device = Device(data['mac'], name, now)
self.last_results.append(device)
self.last_results.extend(exclude_targets)
self.last_results = [Device(data['mac'], name, now)
for name, data in actiontec_data.items()
if data['timevalid'] > -60]
_LOGGER.info("actiontec scan successful")
return True
@@ -186,6 +128,7 @@ class ActiontecDeviceScanner(object):
if match is not None:
devices[match.group('ip')] = {
'ip': match.group('ip'),
'mac': match.group('mac').upper()
'mac': match.group('mac').upper(),
'timevalid': int(match.group('timevalid'))
}
return devices
@@ -4,39 +4,13 @@ homeassistant.components.device_tracker.aruba
Device tracker platform that supports scanning a Aruba Access Point for device
presence.
This device tracker needs telnet to be enabled on the router.
Configuration:
To use the Aruba tracker you will need to add something like the following
to your configuration.yaml file. You also need to enable Telnet in the
configuration page of your router.
device_tracker:
platform: aruba
host: YOUR_ACCESS_POINT_IP
username: YOUR_ADMIN_USERNAME
password: YOUR_ADMIN_PASSWORD
Variables:
host
*Required
The IP address of your router, e.g. 192.168.1.1.
username
*Required
The username of an user with administrative privileges, usually 'admin'.
password
*Required
The password for your given admin account.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.aruba/
"""
import logging
from datetime import timedelta
import re
import threading
import telnetlib
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
from homeassistant.helpers import validate_config
@@ -46,6 +20,7 @@ from homeassistant.components.device_tracker import DOMAIN
# Return cached results if last scan was less then this time ago
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
REQUIREMENTS = ['pexpect==4.0.1']
_LOGGER = logging.getLogger(__name__)
_DEVICES_REGEX = re.compile(
@@ -69,6 +44,7 @@ def get_scanner(hass, config):
class ArubaDeviceScanner(object):
""" This class queries a Aruba Acces Point for connected devices. """
def __init__(self, config):
self.host = config[CONF_HOST]
self.username = config[CONF_USERNAME]
@@ -118,23 +94,39 @@ class ArubaDeviceScanner(object):
def get_aruba_data(self):
""" Retrieve data from Aruba Access Point and return parsed result. """
try:
telnet = telnetlib.Telnet(self.host)
telnet.read_until(b'User: ')
telnet.write((self.username + '\r\n').encode('ascii'))
telnet.read_until(b'Password: ')
telnet.write((self.password + '\r\n').encode('ascii'))
telnet.read_until(b'#')
telnet.write(('show clients\r\n').encode('ascii'))
devices_result = telnet.read_until(b'#').split(b'\r\n')
telnet.write('exit\r\n'.encode('ascii'))
except EOFError:
_LOGGER.exception("Unexpected response from router")
import pexpect
connect = "ssh {}@{}"
ssh = pexpect.spawn(connect.format(self.username, self.host))
query = ssh.expect(['password:', pexpect.TIMEOUT, pexpect.EOF,
'continue connecting (yes/no)?',
'Host key verification failed.',
'Connection refused',
'Connection timed out'], timeout=120)
if query == 1:
_LOGGER.error("Timeout")
return
except ConnectionRefusedError:
_LOGGER.exception("Connection refused by router," +
" is telnet enabled?")
elif query == 2:
_LOGGER.error("Unexpected response from router")
return
elif query == 3:
ssh.sendline('yes')
ssh.expect('password:')
elif query == 4:
_LOGGER.error("Host key Changed")
return
elif query == 5:
_LOGGER.error("Connection refused by server")
return
elif query == 6:
_LOGGER.error("Connection timed out")
return
ssh.sendline(self.password)
ssh.expect('#')
ssh.sendline('show clients')
ssh.expect('#')
devices_result = ssh.before.split(b'\r\n')
ssh.sendline('exit')
devices = {}
for device in devices_result:
@@ -144,5 +136,5 @@ class ArubaDeviceScanner(object):
'ip': match.group('ip'),
'mac': match.group('mac').upper(),
'name': match.group('name')
}
}
return devices
@@ -4,32 +4,8 @@ homeassistant.components.device_tracker.asuswrt
Device tracker platform that supports scanning a ASUSWRT router for device
presence.
This device tracker needs telnet to be enabled on the router.
Configuration:
To use the ASUSWRT tracker you will need to add something like the following
to your configuration.yaml file.
device_tracker:
platform: asuswrt
host: YOUR_ROUTER_IP
username: YOUR_ADMIN_USERNAME
password: YOUR_ADMIN_PASSWORD
Variables:
host
*Required
The IP address of your router, e.g. 192.168.1.1.
username
*Required
The username of an user with administrative privileges, usually 'admin'.
password
*Required
The password for your given admin account.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.asuswrt/
"""
import logging
from datetime import timedelta
@@ -82,8 +58,8 @@ class AsusWrtDeviceScanner(object):
def __init__(self, config):
self.host = config[CONF_HOST]
self.username = config[CONF_USERNAME]
self.password = config[CONF_PASSWORD]
self.username = str(config[CONF_USERNAME])
self.password = str(config[CONF_PASSWORD])
self.lock = threading.Lock()
@@ -157,15 +133,30 @@ class AsusWrtDeviceScanner(object):
devices = {}
for lease in leases_result:
match = _LEASES_REGEX.search(lease.decode('utf-8'))
if not match:
_LOGGER.warning("Could not parse lease row: %s", lease)
continue
# For leases where the client doesn't set a hostname, ensure
# it is blank and not '*', which breaks the entity_id down
# the line
host = match.group('host')
if host == '*':
host = ''
devices[match.group('ip')] = {
'host': host,
'status': '',
'ip': match.group('ip'),
'mac': match.group('mac').upper(),
'host': match.group('host'),
'status': ''
}
for neighbor in neighbors:
match = _IP_NEIGH_REGEX.search(neighbor.decode('utf-8'))
if not match:
_LOGGER.warning("Could not parse neighbor row: %s", neighbor)
continue
if match.group('ip') in devices:
devices[match.group('ip')]['status'] = match.group('status')
return devices
@@ -4,30 +4,8 @@ homeassistant.components.device_tracker.ddwrt
Device tracker platform that supports scanning a DD-WRT router for device
presence.
Configuration:
To use the DD-WRT tracker you will need to add something like the following
to your configuration.yaml file.
device_tracker:
platform: ddwrt
host: YOUR_ROUTER_IP
username: YOUR_ADMIN_USERNAME
password: YOUR_ADMIN_PASSWORD
Variables:
host
*Required
The IP address of your router, e.g. 192.168.1.1.
username
*Required
The username of an user with administrative privileges, usually 'admin'.
password
*Required
The password for your given admin account.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.ddwrt/
"""
import logging
from datetime import timedelta
@@ -46,6 +24,7 @@ MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
_LOGGER = logging.getLogger(__name__)
_DDWRT_DATA_REGEX = re.compile(r'\{(\w+)::([^\}]*)\}')
_MAC_REGEX = re.compile(r'(([0-9A-Fa-f]{1,2}\:){5}[0-9A-Fa-f]{1,2})')
# pylint: disable=unused-argument
@@ -77,7 +56,7 @@ class DdWrtDeviceScanner(object):
self.last_results = {}
self.mac2name = None
self.mac2name = {}
# Test the router is accessible
url = 'http://{}/Status_Wireless.live.asp'.format(self.host)
@@ -98,30 +77,33 @@ class DdWrtDeviceScanner(object):
with self.lock:
# if not initialised and not already scanned and not found
if self.mac2name is None or device not in self.mac2name:
if device not in self.mac2name:
url = 'http://{}/Status_Lan.live.asp'.format(self.host)
data = self.get_ddwrt_data(url)
if not data:
return
return None
dhcp_leases = data.get('dhcp_leases', None)
if dhcp_leases:
# remove leading and trailing single quotes
cleaned_str = dhcp_leases.strip().strip('"')
elements = cleaned_str.split('","')
num_clients = int(len(elements)/5)
self.mac2name = {}
for idx in range(0, num_clients):
# this is stupid but the data is a single array
# every 5 elements represents one hosts, the MAC
# is the third element and the name is the first
mac_index = (idx * 5) + 2
if mac_index < len(elements):
mac = elements[mac_index]
self.mac2name[mac] = elements[idx * 5]
return self.mac2name.get(device, None)
if not dhcp_leases:
return None
# remove leading and trailing single quotes
cleaned_str = dhcp_leases.strip().strip('"')
elements = cleaned_str.split('","')
num_clients = int(len(elements)/5)
self.mac2name = {}
for idx in range(0, num_clients):
# this is stupid but the data is a single array
# every 5 elements represents one hosts, the MAC
# is the third element and the name is the first
mac_index = (idx * 5) + 2
if mac_index < len(elements):
mac = elements[mac_index]
self.mac2name[mac] = elements[idx * 5]
return self.mac2name.get(device)
@Throttle(MIN_TIME_BETWEEN_SCANS)
def _update_info(self):
@@ -141,29 +123,25 @@ class DdWrtDeviceScanner(object):
if not data:
return False
if data:
self.last_results = []
active_clients = data.get('active_wireless', None)
if active_clients:
# This is really lame, instead of using JSON the DD-WRT UI
# uses its own data format for some reason and then
# regex's out values so I guess I have to do the same,
# LAME!!!
self.last_results = []
# remove leading and trailing single quotes
clean_str = active_clients.strip().strip("'")
elements = clean_str.split("','")
active_clients = data.get('active_wireless', None)
if not active_clients:
return False
num_clients = int(len(elements)/9)
for idx in range(0, num_clients):
# get every 9th element which is the MAC address
index = idx * 9
if index < len(elements):
self.last_results.append(elements[index])
# This is really lame, instead of using JSON the DD-WRT UI
# uses its own data format for some reason and then
# regex's out values so I guess I have to do the same,
# LAME!!!
return True
# remove leading and trailing single quotes
clean_str = active_clients.strip().strip("'")
elements = clean_str.split("','")
return False
self.last_results.extend(item for item in elements
if _MAC_REGEX.match(item))
return True
def get_ddwrt_data(self, url):
""" Retrieve data from DD-WRT and return parsed result. """
@@ -0,0 +1,49 @@
"""
homeassistant.components.device_tracker.demo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo platform for the device tracker.
device_tracker:
platform: demo
"""
import random
from homeassistant.components.device_tracker import DOMAIN
def setup_scanner(hass, config, see):
""" Set up a demo tracker. """
def offset():
""" Return random offset. """
return (random.randrange(500, 2000)) / 2e5 * random.choice((-1, 1))
def random_see(dev_id, name):
""" Randomize a sighting. """
see(
dev_id=dev_id,
host_name=name,
gps=(hass.config.latitude + offset(),
hass.config.longitude + offset()),
gps_accuracy=random.randrange(50, 150),
battery=random.randrange(10, 90)
)
def observe(call=None):
""" Observe three entities. """
random_see('demo_paulus', 'Paulus')
random_see('demo_anne_therese', 'Anne Therese')
observe()
see(
dev_id='demo_home_boy',
host_name='Home Boy',
gps=[hass.config.latitude - 0.00002, hass.config.longitude + 0.00002],
gps_accuracy=20,
battery=53
)
hass.services.register(DOMAIN, 'demo', observe)
return True
@@ -0,0 +1,116 @@
"""
homeassistant.components.device_tracker.fritz
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Device tracker platform that supports scanning a FRITZ!Box router for device
presence.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.fritz/
"""
import logging
from datetime import timedelta
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
from homeassistant.helpers import validate_config
from homeassistant.util import Throttle
from homeassistant.components.device_tracker import DOMAIN
REQUIREMENTS = ['fritzconnection==0.4.6']
# Return cached results if last scan was less then this time ago
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
_LOGGER = logging.getLogger(__name__)
# noinspection PyUnusedLocal
def get_scanner(hass, config):
""" Validates config and returns FritzBoxScanner. """
if not validate_config(config,
{DOMAIN: []},
_LOGGER):
return None
scanner = FritzBoxScanner(config[DOMAIN])
return scanner if scanner.success_init else None
# pylint: disable=too-many-instance-attributes
class FritzBoxScanner(object):
"""
This class queries a FRITZ!Box router. It is using the
fritzconnection library for communication with the router.
The API description can be found under:
https://pypi.python.org/pypi/fritzconnection/0.4.6
This scanner retrieves the list of known hosts and checks their
corresponding states (on, or off).
Due to a bug of the fritzbox api (router side) it is not possible
to track more than 16 hosts.
"""
def __init__(self, config):
self.last_results = []
self.host = '169.254.1.1' # This IP is valid for all fritzboxes
self.username = 'admin'
self.password = ''
self.success_init = True
# pylint: disable=import-error
import fritzconnection as fc
# Check for user specific configuration
if CONF_HOST in config.keys():
self.host = config[CONF_HOST]
if CONF_USERNAME in config.keys():
self.username = config[CONF_USERNAME]
if CONF_PASSWORD in config.keys():
self.password = config[CONF_PASSWORD]
# Establish a connection to the FRITZ!Box
try:
self.fritz_box = fc.FritzHosts(address=self.host,
user=self.username,
password=self.password)
except (ValueError, TypeError):
self.fritz_box = None
# At this point it is difficult to tell if a connection is established.
# So just check for null objects ...
if self.fritz_box is None or not self.fritz_box.modelname:
self.success_init = False
if self.success_init:
_LOGGER.info("Successfully connected to %s",
self.fritz_box.modelname)
self._update_info()
else:
_LOGGER.error("Failed to establish connection to FRITZ!Box "
"with IP: %s", self.host)
def scan_devices(self):
""" Scan for new devices and return a list of found device ids. """
self._update_info()
active_hosts = []
for known_host in self.last_results:
if known_host["status"] == "1":
active_hosts.append(known_host["mac"])
return active_hosts
def get_device_name(self, mac):
""" Returns the name of the given device or None if is not known. """
ret = self.fritz_box.get_specific_host_entry(mac)["NewHostName"]
if ret == {}:
return None
return ret
@Throttle(MIN_TIME_BETWEEN_SCANS)
def _update_info(self):
""" Retrieves latest information from the FRITZ!Box. """
if not self.success_init:
return False
_LOGGER.info("Scanning")
self.last_results = self.fritz_box.get_hosts_info()
return True
@@ -0,0 +1,87 @@
"""
homeassistant.components.device_tracker.icloud
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Device tracker platform that supports scanning iCloud devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.icloud/
"""
import logging
import re
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD
from homeassistant.helpers.event import track_utc_time_change
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['pyicloud==0.7.2']
CONF_INTERVAL = 'interval'
DEFAULT_INTERVAL = 8
def setup_scanner(hass, config, see):
""" Set up the iCloud Scanner. """
from pyicloud import PyiCloudService
from pyicloud.exceptions import PyiCloudFailedLoginException
from pyicloud.exceptions import PyiCloudNoDevicesException
# Get the username and password from the configuration
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
if username is None or password is None:
_LOGGER.error('Must specify a username and password')
return False
try:
_LOGGER.info('Logging into iCloud Account')
# Attempt the login to iCloud
api = PyiCloudService(username,
password,
verify=True)
except PyiCloudFailedLoginException as error:
_LOGGER.exception('Error logging into iCloud Service: %s', error)
return False
def keep_alive(now):
""" Keeps authenticating iCloud connection. """
api.authenticate()
_LOGGER.info("Authenticate against iCloud")
track_utc_time_change(hass, keep_alive, second=0)
def update_icloud(now):
""" Authenticate against iCloud and scan for devices. """
try:
# The session timeouts if we are not using it so we
# have to re-authenticate. This will send an email.
api.authenticate()
# Loop through every device registered with the iCloud account
for device in api.devices:
status = device.status()
location = device.location()
# If the device has a location add it. If not do nothing
if location:
see(
dev_id=re.sub(r"(\s|\W|')",
'',
status['name']),
host_name=status['name'],
gps=(location['latitude'], location['longitude']),
battery=status['batteryLevel']*100,
gps_accuracy=location['horizontalAccuracy']
)
else:
# No location found for the device so continue
continue
except PyiCloudNoDevicesException:
_LOGGER.info('No iCloud Devices found!')
track_utc_time_change(
hass, update_icloud,
minute=range(0, 60, config.get(CONF_INTERVAL, DEFAULT_INTERVAL)),
second=0
)
return True
@@ -0,0 +1,104 @@
"""
homeassistant.components.device_tracker.locative
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Locative platform for the device tracker.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.locative/
"""
import logging
from functools import partial
from homeassistant.const import (
HTTP_UNPROCESSABLE_ENTITY, STATE_NOT_HOME)
from homeassistant.components.device_tracker import DOMAIN
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['http']
URL_API_LOCATIVE_ENDPOINT = "/api/locative"
def setup_scanner(hass, config, see):
""" Set up an endpoint for the Locative app. """
# POST would be semantically better, but that currently does not work
# since Locative sends the data as key1=value1&key2=value2
# in the request body, while Home Assistant expects json there.
hass.http.register_path(
'GET', URL_API_LOCATIVE_ENDPOINT,
partial(_handle_get_api_locative, hass, see))
return True
def _handle_get_api_locative(hass, see, handler, path_match, data):
""" Locative message received. """
if not _check_data(handler, data):
return
device = data['device'].replace('-', '')
location_name = data['id'].lower()
direction = data['trigger']
if direction == 'enter':
see(dev_id=device, location_name=location_name)
handler.write_text("Setting location to {}".format(location_name))
elif direction == 'exit':
current_state = hass.states.get("{}.{}".format(DOMAIN, device))
if current_state is None or current_state.state == location_name:
see(dev_id=device, location_name=STATE_NOT_HOME)
handler.write_text("Setting location to not home")
else:
# Ignore the message if it is telling us to exit a zone that we
# aren't currently in. This occurs when a zone is entered before
# the previous zone was exited. The enter message will be sent
# first, then the exit message will be sent second.
handler.write_text(
'Ignoring exit from {} (already in {})'.format(
location_name, current_state))
elif direction == 'test':
# In the app, a test message can be sent. Just return something to
# the user to let them know that it works.
handler.write_text("Received test message.")
else:
handler.write_text(
"Received unidentified message: {}".format(direction),
HTTP_UNPROCESSABLE_ENTITY)
_LOGGER.error("Received unidentified message from Locative: %s",
direction)
def _check_data(handler, data):
if 'latitude' not in data or 'longitude' not in data:
handler.write_text("Latitude and longitude not specified.",
HTTP_UNPROCESSABLE_ENTITY)
_LOGGER.error("Latitude and longitude not specified.")
return False
if 'device' not in data:
handler.write_text("Device id not specified.",
HTTP_UNPROCESSABLE_ENTITY)
_LOGGER.error("Device id not specified.")
return False
if 'id' not in data:
handler.write_text("Location id not specified.",
HTTP_UNPROCESSABLE_ENTITY)
_LOGGER.error("Location id not specified.")
return False
if 'trigger' not in data:
handler.write_text("Trigger is not specified.",
HTTP_UNPROCESSABLE_ENTITY)
_LOGGER.error("Trigger is not specified.")
return False
return True
@@ -4,33 +4,8 @@ homeassistant.components.device_tracker.luci
Device tracker platform that supports scanning a OpenWRT router for device
presence.
It's required that the luci RPC package is installed on the OpenWRT router:
# opkg install luci-mod-rpc
Configuration:
To use the Luci tracker you will need to add something like the following
to your configuration.yaml file.
device_tracker:
platform: luci
host: YOUR_ROUTER_IP
username: YOUR_ADMIN_USERNAME
password: YOUR_ADMIN_PASSWORD
Variables:
host
*Required
The IP address of your router, e.g. 192.168.1.1.
username
*Required
The username of an user with administrative privileges, usually 'admin'.
password
*Required
The password for your given admin account.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.luci/
"""
import logging
import json
@@ -0,0 +1,43 @@
"""
homeassistant.components.device_tracker.mqtt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MQTT platform for the device tracker.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.mqtt/
"""
import logging
from homeassistant import util
import homeassistant.components.mqtt as mqtt
DEPENDENCIES = ['mqtt']
CONF_QOS = 'qos'
CONF_DEVICES = 'devices'
DEFAULT_QOS = 0
_LOGGER = logging.getLogger(__name__)
def setup_scanner(hass, config, see):
""" Set up a MQTT tracker. """
devices = config.get(CONF_DEVICES)
qos = util.convert(config.get(CONF_QOS), int, DEFAULT_QOS)
if not isinstance(devices, dict):
_LOGGER.error('Expected %s to be a dict, found %s', CONF_DEVICES,
devices)
return False
dev_id_lookup = {}
def device_tracker_message_received(topic, payload, qos):
""" MQTT message received. """
see(dev_id=dev_id_lookup[topic], location_name=payload)
for dev_id, topic in devices.items():
dev_id_lookup[topic] = dev_id
mqtt.subscribe(hass, topic, device_tracker_message_received, qos)
return True
@@ -4,30 +4,8 @@ homeassistant.components.device_tracker.netgear
Device tracker platform that supports scanning a Netgear router for device
presence.
Configuration:
To use the Netgear tracker you will need to add something like the following
to your configuration.yaml file.
device_tracker:
platform: netgear
host: YOUR_ROUTER_IP
username: YOUR_ADMIN_USERNAME
password: YOUR_ADMIN_PASSWORD
Variables:
host
*Required
The IP address of your router, e.g. 192.168.1.1.
username
*Required
The username of an user with administrative privileges, usually 'admin'.
password
*Required
The password for your given admin account.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.netgear/
"""
import logging
from datetime import timedelta
@@ -41,7 +19,7 @@ from homeassistant.components.device_tracker import DOMAIN
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['pynetgear==0.3']
REQUIREMENTS = ['pynetgear==0.3.2']
def get_scanner(hass, config):
@@ -70,7 +48,6 @@ class NetgearDeviceScanner(object):
self.lock = threading.Lock()
if host is None:
print("BIER")
self._api = pynetgear.Netgear()
elif username is None:
self._api = pynetgear.Netgear(password, host)
@@ -3,26 +3,8 @@ homeassistant.components.device_tracker.nmap
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Device tracker platform that supports scanning a network with nmap.
Configuration:
To use the nmap tracker you will need to add something like the following
to your configuration.yaml file.
device_tracker:
platform: nmap_tracker
hosts: 192.168.1.1/24
Variables:
hosts
*Required
The IP addresses to scan in the network-prefix notation (192.168.1.1/24) or
the range notation (192.168.1.1-255).
home_interval
*Optional
Number of minutes it will not scan devices that it found in previous results.
This is to save battery.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.nmap_scanner/
"""
import logging
from datetime import timedelta
@@ -44,7 +26,7 @@ _LOGGER = logging.getLogger(__name__)
# interval in minutes to exclude devices from a scan while they are home
CONF_HOME_INTERVAL = "home_interval"
REQUIREMENTS = ['python-nmap==0.4.1']
REQUIREMENTS = ['python-nmap==0.4.3']
def get_scanner(hass, config):
@@ -116,16 +98,19 @@ class NmapDeviceScanner(object):
from nmap import PortScanner, PortScannerError
scanner = PortScanner()
options = "-F --host-timeout 5"
exclude_targets = set()
options = "-F --host-timeout 5s"
if self.home_interval:
now = dt_util.now()
for host in self.last_results:
if host.last_update + self.home_interval > now:
exclude_targets.add(host)
if len(exclude_targets) > 0:
target_list = [t.ip for t in exclude_targets]
options += " --exclude {}".format(",".join(target_list))
boundary = dt_util.now() - self.home_interval
last_results = [device for device in self.last_results
if device.last_update > boundary]
if last_results:
# Pylint is confused here.
# pylint: disable=no-member
options += " --exclude {}".format(",".join(device.ip for device
in last_results))
else:
last_results = []
try:
result = scanner.scan(hosts=self.hosts, arguments=options)
@@ -133,18 +118,17 @@ class NmapDeviceScanner(object):
return False
now = dt_util.now()
self.last_results = []
for ipv4, info in result['scan'].items():
if info['status']['state'] != 'up':
continue
name = info['hostnames'][0] if info['hostnames'] else ipv4
name = info['hostnames'][0]['name'] if info['hostnames'] else ipv4
# Mac address only returned if nmap ran as root
mac = info['addresses'].get('mac') or _arp(ipv4)
if mac is None:
continue
device = Device(mac.upper(), name, ipv4, now)
self.last_results.append(device)
self.last_results.extend(exclude_targets)
last_results.append(Device(mac.upper(), name, ipv4, now))
self.last_results = last_results
_LOGGER.info("nmap scan successful")
return True
@@ -0,0 +1,183 @@
"""
homeassistant.components.device_tracker.owntracks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OwnTracks platform for the device tracker.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.owntracks/
"""
import json
import logging
import threading
from collections import defaultdict
import homeassistant.components.mqtt as mqtt
from homeassistant.const import STATE_HOME
DEPENDENCIES = ['mqtt']
REGIONS_ENTERED = defaultdict(list)
MOBILE_BEACONS_ACTIVE = defaultdict(list)
BEACON_DEV_ID = 'beacon'
LOCATION_TOPIC = 'owntracks/+/+'
EVENT_TOPIC = 'owntracks/+/+/event'
_LOGGER = logging.getLogger(__name__)
LOCK = threading.Lock()
def setup_scanner(hass, config, see):
""" Set up an OwnTracks tracker. """
def owntracks_location_update(topic, payload, qos):
""" MQTT message received. """
# Docs on available data:
# http://owntracks.org/booklet/tech/json/#_typelocation
try:
data = json.loads(payload)
except ValueError:
# If invalid JSON
_LOGGER.error(
'Unable to parse payload as JSON: %s', payload)
return
if not isinstance(data, dict) or data.get('_type') != 'location':
return
dev_id, kwargs = _parse_see_args(topic, data)
# Block updates if we're in a region
with LOCK:
if REGIONS_ENTERED[dev_id]:
_LOGGER.debug(
"location update ignored - inside region %s",
REGIONS_ENTERED[-1])
return
see(**kwargs)
see_beacons(dev_id, kwargs)
def owntracks_event_update(topic, payload, qos):
# pylint: disable=too-many-branches
""" MQTT event (geofences) received. """
# Docs on available data:
# http://owntracks.org/booklet/tech/json/#_typetransition
try:
data = json.loads(payload)
except ValueError:
# If invalid JSON
_LOGGER.error(
'Unable to parse payload as JSON: %s', payload)
return
if not isinstance(data, dict) or data.get('_type') != 'transition':
return
# OwnTracks uses - at the start of a beacon zone
# to switch on 'hold mode' - ignore this
location = data['desc'].lstrip("-")
if location.lower() == 'home':
location = STATE_HOME
dev_id, kwargs = _parse_see_args(topic, data)
if data['event'] == 'enter':
zone = hass.states.get("zone.{}".format(location))
with LOCK:
if zone is None:
if data['t'] == 'b':
# Not a HA zone, and a beacon so assume mobile
MOBILE_BEACONS_ACTIVE[dev_id].append(location)
else:
# Normal region
if not zone.attributes.get('passive'):
kwargs['location_name'] = location
regions = REGIONS_ENTERED[dev_id]
if location not in regions:
regions.append(location)
_LOGGER.info("Enter region %s", location)
_set_gps_from_zone(kwargs, zone)
see(**kwargs)
see_beacons(dev_id, kwargs)
elif data['event'] == 'leave':
regions = REGIONS_ENTERED[dev_id]
if location in regions:
regions.remove(location)
new_region = regions[-1] if regions else None
if new_region:
# Exit to previous region
zone = hass.states.get("zone.{}".format(new_region))
if not zone.attributes.get('passive'):
kwargs['location_name'] = new_region
_set_gps_from_zone(kwargs, zone)
_LOGGER.info("Exit from to %s", new_region)
else:
_LOGGER.info("Exit to GPS")
see(**kwargs)
see_beacons(dev_id, kwargs)
beacons = MOBILE_BEACONS_ACTIVE[dev_id]
if location in beacons:
beacons.remove(location)
else:
_LOGGER.error(
'Misformatted mqtt msgs, _type=transition, event=%s',
data['event'])
return
def see_beacons(dev_id, kwargs_param):
""" Set active beacons to the current location """
kwargs = kwargs_param.copy()
for beacon in MOBILE_BEACONS_ACTIVE[dev_id]:
kwargs['dev_id'] = "{}_{}".format(BEACON_DEV_ID, beacon)
kwargs['host_name'] = beacon
see(**kwargs)
mqtt.subscribe(hass, LOCATION_TOPIC, owntracks_location_update, 1)
mqtt.subscribe(hass, EVENT_TOPIC, owntracks_event_update, 1)
return True
def _parse_see_args(topic, data):
""" Parse the OwnTracks location parameters,
into the format see expects. """
parts = topic.split('/')
dev_id = '{}_{}'.format(parts[1], parts[2])
host_name = parts[1]
kwargs = {
'dev_id': dev_id,
'host_name': host_name,
'gps': (data['lat'], data['lon'])
}
if 'acc' in data:
kwargs['gps_accuracy'] = data['acc']
if 'batt' in data:
kwargs['battery'] = data['batt']
return dev_id, kwargs
def _set_gps_from_zone(kwargs, zone):
""" Set the see parameters from the zone parameters """
if zone is not None:
kwargs['gps'] = (
zone.attributes['latitude'],
zone.attributes['longitude'])
kwargs['gps_accuracy'] = zone.attributes['radius']
return kwargs
@@ -0,0 +1,33 @@
# Describes the format for available device tracker services
see:
description: Control tracked device
fields:
mac:
description: MAC address of device
example: 'FF:FF:FF:FF:FF:FF'
dev_id:
description: Id of device (find id in known_devices.yaml)
example: 'phonedave'
host_name:
description: Hostname of device
example: 'Dave'
location_name:
description: Name of location where device is located (not_home is away)
example: 'home'
gps:
description: GPS coordinates where device is located (latitude, longitude)
example: '[51.509802, -0.086692]'
gps_accuracy:
description: Accuracy of GPS coordinates
example: '80'
battery:
description: Battery level of device
example: '100'
@@ -0,0 +1,116 @@
"""
homeassistant.components.device_tracker.snmp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Device tracker platform that supports fetching WiFi associations
through SNMP.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.snmp/
"""
import logging
from datetime import timedelta
import threading
import binascii
from homeassistant.const import CONF_HOST
from homeassistant.helpers import validate_config
from homeassistant.util import Throttle
from homeassistant.components.device_tracker import DOMAIN
# Return cached results if last scan was less then this time ago
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['pysnmp==4.2.5']
CONF_COMMUNITY = "community"
CONF_BASEOID = "baseoid"
# pylint: disable=unused-argument
def get_scanner(hass, config):
""" Validates config and returns an snmp scanner """
if not validate_config(config,
{DOMAIN: [CONF_HOST, CONF_COMMUNITY, CONF_BASEOID]},
_LOGGER):
return None
scanner = SnmpScanner(config[DOMAIN])
return scanner if scanner.success_init else None
class SnmpScanner(object):
"""
This class queries any SNMP capable Acces Point for connected devices.
"""
def __init__(self, config):
from pysnmp.entity.rfc3413.oneliner import cmdgen
self.snmp = cmdgen.CommandGenerator()
self.host = cmdgen.UdpTransportTarget((config[CONF_HOST], 161))
self.community = cmdgen.CommunityData(config[CONF_COMMUNITY])
self.baseoid = cmdgen.MibVariable(config[CONF_BASEOID])
self.lock = threading.Lock()
self.last_results = []
# Test the router is accessible
data = self.get_snmp_data()
self.success_init = data is not None
def scan_devices(self):
"""
Scans for new devices and return a list containing found device IDs.
"""
self._update_info()
return [client['mac'] for client in self.last_results]
# Supressing no-self-use warning
# pylint: disable=R0201
def get_device_name(self, device):
""" Returns the name of the given device or None if we don't know. """
# We have no names
return None
@Throttle(MIN_TIME_BETWEEN_SCANS)
def _update_info(self):
"""
Ensures the information from the WAP is up to date.
Returns boolean if scanning successful.
"""
if not self.success_init:
return False
with self.lock:
data = self.get_snmp_data()
if not data:
return False
self.last_results = data
return True
def get_snmp_data(self):
""" Fetch mac addresses from WAP via SNMP. """
devices = []
errindication, errstatus, errindex, restable = self.snmp.nextCmd(
self.community, self.host, self.baseoid)
if errindication:
_LOGGER.error("SNMPLIB error: %s", errindication)
return
if errstatus:
_LOGGER.error('SNMP error: %s at %s', errstatus.prettyPrint(),
errindex and restable[-1][int(errindex)-1] or '?')
return
for resrow in restable:
for _, val in resrow:
mac = binascii.hexlify(val.asOctets()).decode('utf-8')
mac = ':'.join([mac[i:i+2] for i in range(0, len(mac), 2)])
devices.append({'mac': mac})
return devices
@@ -4,32 +4,8 @@ homeassistant.components.device_tracker.thomson
Device tracker platform that supports scanning a THOMSON router for device
presence.
This device tracker needs telnet to be enabled on the router.
Configuration:
To use the THOMSON tracker you will need to add something like the following
to your configuration.yaml file.
device_tracker:
platform: thomson
host: YOUR_ROUTER_IP
username: YOUR_ADMIN_USERNAME
password: YOUR_ADMIN_PASSWORD
Variables:
host
*Required
The IP address of your router, e.g. 192.168.1.1.
username
*Required
The username of an user with administrative privileges, usually 'admin'.
password
*Required
The password for your given admin account.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.thomson/
"""
import logging
from datetime import timedelta
@@ -4,36 +4,8 @@ homeassistant.components.device_tracker.tomato
Device tracker platform that supports scanning a Tomato router for device
presence.
Configuration:
To use the Tomato tracker you will need to add something like the following
to your configuration.yaml file.
device_tracker:
platform: tomato
host: YOUR_ROUTER_IP
username: YOUR_ADMIN_USERNAME
password: YOUR_ADMIN_PASSWORD
http_id: ABCDEFG
Variables:
host
*Required
The IP address of your router, e.g. 192.168.1.1.
username
*Required
The username of an user with administrative privileges, usually 'admin'.
password
*Required
The password for your given admin account.
http_id
*Required
The value can be obtained by logging in to the Tomato admin interface and
search for http_id in the page source code.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.tomato/
"""
import logging
import json
+122 -29
View File
@@ -4,30 +4,8 @@ homeassistant.components.device_tracker.tplink
Device tracker platform that supports scanning a TP-Link router for device
presence.
Configuration:
To use the TP-Link tracker you will need to add something like the following
to your configuration.yaml file.
device_tracker:
platform: tplink
host: YOUR_ROUTER_IP
username: YOUR_ADMIN_USERNAME
password: YOUR_ADMIN_PASSWORD
Variables:
host
*Required
The IP address of your router, e.g. 192.168.1.1.
username
*Required
The username of an user with administrative privileges, usually 'admin'.
password
*Required
The password for your given admin account.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.tplink/
"""
import base64
import logging
@@ -54,10 +32,13 @@ def get_scanner(hass, config):
_LOGGER):
return None
scanner = Tplink2DeviceScanner(config[DOMAIN])
scanner = Tplink3DeviceScanner(config[DOMAIN])
if not scanner.success_init:
scanner = TplinkDeviceScanner(config[DOMAIN])
scanner = Tplink2DeviceScanner(config[DOMAIN])
if not scanner.success_init:
scanner = TplinkDeviceScanner(config[DOMAIN])
return scanner if scanner.success_init else None
@@ -156,7 +137,7 @@ class Tplink2DeviceScanner(TplinkDeviceScanner):
with self.lock:
_LOGGER.info("Loading wireless clients...")
url = 'http://{}/data/map_access_wireless_client_grid.json'\
url = 'http://{}/data/map_access_wireless_client_grid.json' \
.format(self.host)
referer = 'http://{}'.format(self.host)
@@ -166,7 +147,7 @@ class Tplink2DeviceScanner(TplinkDeviceScanner):
b64_encoded_username_password = base64.b64encode(
username_password.encode('ascii')
).decode('ascii')
cookie = 'Authorization=Basic {}'\
cookie = 'Authorization=Basic {}' \
.format(b64_encoded_username_password)
response = requests.post(url, headers={'referer': referer,
@@ -183,7 +164,119 @@ class Tplink2DeviceScanner(TplinkDeviceScanner):
self.last_results = {
device['mac_addr'].replace('-', ':'): device['name']
for device in result
}
}
return True
return False
class Tplink3DeviceScanner(TplinkDeviceScanner):
"""
This class queries the Archer C9 router running version 150811 or higher
of TP-Link firmware for connected devices.
"""
def __init__(self, config):
self.stok = ''
self.sysauth = ''
super(Tplink3DeviceScanner, self).__init__(config)
def scan_devices(self):
"""
Scans for new devices and return a list containing found device ids.
"""
self._update_info()
return self.last_results.keys()
# pylint: disable=no-self-use
def get_device_name(self, device):
"""
The TP-Link firmware doesn't save the name of the wireless device.
We are forced to use the MAC address as name here.
"""
return self.last_results.get(device)
def _get_auth_tokens(self):
"""
Retrieves auth tokens from the router.
"""
_LOGGER.info("Retrieving auth tokens...")
url = 'http://{}/cgi-bin/luci/;stok=/login?form=login' \
.format(self.host)
referer = 'http://{}/webpages/login.html'.format(self.host)
# if possible implement rsa encryption of password here
response = requests.post(url,
params={'operation': 'login',
'username': self.username,
'password': self.password},
headers={'referer': referer})
try:
self.stok = response.json().get('data').get('stok')
_LOGGER.info(self.stok)
regex_result = re.search('sysauth=(.*);',
response.headers['set-cookie'])
self.sysauth = regex_result.group(1)
_LOGGER.info(self.sysauth)
return True
except ValueError:
_LOGGER.error("Couldn't fetch auth tokens!")
return False
@Throttle(MIN_TIME_BETWEEN_SCANS)
def _update_info(self):
"""
Ensures the information from the TP-Link router is up to date.
Returns boolean if scanning successful.
"""
with self.lock:
if (self.stok == '') or (self.sysauth == ''):
self._get_auth_tokens()
_LOGGER.info("Loading wireless clients...")
url = ('http://{}/cgi-bin/luci/;stok={}/admin/wireless?'
'form=statistics').format(self.host, self.stok)
referer = 'http://{}/webpages/index.html'.format(self.host)
response = requests.post(url,
params={'operation': 'load'},
headers={'referer': referer},
cookies={'sysauth': self.sysauth})
try:
json_response = response.json()
if json_response.get('success'):
result = response.json().get('data')
else:
if json_response.get('errorcode') == 'timeout':
_LOGGER.info("Token timed out. "
"Relogging on next scan.")
self.stok = ''
self.sysauth = ''
return False
else:
_LOGGER.error("An unknown error happened "
"while fetching data.")
return False
except ValueError:
_LOGGER.error("Router didn't respond with JSON. "
"Check if credentials are correct.")
return False
if result:
self.last_results = {
device['mac'].replace('-', ':'): device['mac']
for device in result
}
return True
return False
@@ -0,0 +1,173 @@
"""
homeassistant.components.device_tracker.ubus
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Device tracker platform that supports scanning a OpenWRT router for device
presence.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.ubus/
"""
import logging
import json
from datetime import timedelta
import re
import threading
import requests
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
from homeassistant.helpers import validate_config
from homeassistant.util import Throttle
from homeassistant.components.device_tracker import DOMAIN
# Return cached results if last scan was less then this time ago
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
_LOGGER = logging.getLogger(__name__)
def get_scanner(hass, config):
""" Validates config and returns a Luci scanner. """
if not validate_config(config,
{DOMAIN: [CONF_HOST, CONF_USERNAME, CONF_PASSWORD]},
_LOGGER):
return None
scanner = UbusDeviceScanner(config[DOMAIN])
return scanner if scanner.success_init else None
# pylint: disable=too-many-instance-attributes
class UbusDeviceScanner(object):
"""
This class queries a wireless router running OpenWrt firmware
for connected devices. Adapted from Tomato scanner.
Configure your routers' ubus ACL based on following instructions:
http://wiki.openwrt.org/doc/techref/ubus
Read only access will be fine.
To use this class you have to install rpcd-mod-file package
in your OpenWrt router:
opkg install rpcd-mod-file
"""
def __init__(self, config):
host = config[CONF_HOST]
username, password = config[CONF_USERNAME], config[CONF_PASSWORD]
self.parse_api_pattern = re.compile(r"(?P<param>\w*) = (?P<value>.*);")
self.lock = threading.Lock()
self.last_results = {}
self.url = 'http://{}/ubus'.format(host)
self.session_id = _get_session_id(self.url, username, password)
self.hostapd = []
self.leasefile = None
self.mac2name = None
self.success_init = self.session_id is not None
def scan_devices(self):
"""
Scans for new devices and return a list containing found device ids.
"""
self._update_info()
return self.last_results
def get_device_name(self, device):
""" Returns the name of the given device or None if we don't know. """
with self.lock:
if self.leasefile is None:
result = _req_json_rpc(self.url, self.session_id,
'call', 'uci', 'get',
config="dhcp", type="dnsmasq")
if result:
values = result["values"].values()
self.leasefile = next(iter(values))["leasefile"]
else:
return
if self.mac2name is None:
result = _req_json_rpc(self.url, self.session_id,
'call', 'file', 'read',
path=self.leasefile)
if result:
self.mac2name = dict()
for line in result["data"].splitlines():
hosts = line.split(" ")
self.mac2name[hosts[1].upper()] = hosts[3]
else:
# Error, handled in the _req_json_rpc
return
return self.mac2name.get(device.upper(), None)
@Throttle(MIN_TIME_BETWEEN_SCANS)
def _update_info(self):
"""
Ensures the information from the Luci router is up to date.
Returns boolean if scanning successful.
"""
if not self.success_init:
return False
with self.lock:
_LOGGER.info("Checking ARP")
if not self.hostapd:
hostapd = _req_json_rpc(self.url, self.session_id,
'list', 'hostapd.*', '')
self.hostapd.extend(hostapd.keys())
self.last_results = []
results = 0
for hostapd in self.hostapd:
result = _req_json_rpc(self.url, self.session_id,
'call', hostapd, 'get_clients')
if result:
results = results + 1
self.last_results.extend(result['clients'].keys())
return bool(results)
def _req_json_rpc(url, session_id, rpcmethod, subsystem, method, **params):
""" Perform one JSON RPC operation. """
data = json.dumps({"jsonrpc": "2.0",
"id": 1,
"method": rpcmethod,
"params": [session_id,
subsystem,
method,
params]})
try:
res = requests.post(url, data=data, timeout=5)
except requests.exceptions.Timeout:
return
if res.status_code == 200:
response = res.json()
if rpcmethod == "call":
return response["result"][1]
else:
return response["result"]
def _get_session_id(url, username, password):
""" Get authentication token for the given host+username+password. """
res = _req_json_rpc(url, "00000000000000000000000000000000", 'call',
'session', 'login', username=username,
password=password)
return res["ubus_rpc_session"]
+6 -12
View File
@@ -1,7 +1,6 @@
"""
homeassistant.components.discovery
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Starts a service to scan in intervals for new devices.
Will emit EVENT_PLATFORM_DISCOVERED whenever a new service has been discovered.
@@ -18,23 +17,24 @@ from homeassistant.const import (
ATTR_SERVICE, ATTR_DISCOVERED)
DOMAIN = "discovery"
DEPENDENCIES = []
REQUIREMENTS = ['netdisco==0.3']
REQUIREMENTS = ['netdisco==0.5.2']
SCAN_INTERVAL = 300 # seconds
# Next 3 lines for now a mirror from netdisco.const
# Should setup a mapping netdisco.const -> own constants
SERVICE_WEMO = 'belkin_wemo'
SERVICE_HUE = 'philips_hue'
SERVICE_CAST = 'google_cast'
SERVICE_NETGEAR = 'netgear_router'
SERVICE_SONOS = 'sonos'
SERVICE_PLEX = 'plex_mediaserver'
SERVICE_HANDLERS = {
SERVICE_WEMO: "switch",
SERVICE_CAST: "media_player",
SERVICE_HUE: "light",
SERVICE_NETGEAR: 'device_tracker',
SERVICE_SONOS: 'media_player',
SERVICE_PLEX: 'media_player',
}
@@ -79,13 +79,6 @@ def setup(hass, config):
if not component:
return
# Hack - fix when device_tracker supports discovery
if service == SERVICE_NETGEAR:
bootstrap.setup_component(hass, component, {
'device_tracker': {'platform': 'netgear'}
})
return
# This component cannot be setup.
if not bootstrap.setup_component(hass, component, config):
return
@@ -95,6 +88,7 @@ def setup(hass, config):
ATTR_DISCOVERED: info
})
# pylint: disable=unused-argument
def start_discovery(event):
""" Start discovering. """
netdisco = DiscoveryService(SCAN_INTERVAL)
+9 -10
View File
@@ -1,19 +1,22 @@
"""
homeassistant.components.downloader
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to download files.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/downloader/
"""
import os
import logging
import re
import threading
import requests
from homeassistant.helpers import validate_config
from homeassistant.util import sanitize_filename
DOMAIN = "downloader"
DEPENDENCIES = []
SERVICE_DOWNLOAD_FILE = "download_file"
@@ -29,19 +32,15 @@ def setup(hass, config):
logger = logging.getLogger(__name__)
try:
import requests
except ImportError:
logger.exception(("Failed to import requests. "
"Did you maybe not execute 'pip install requests'?"))
return False
if not validate_config(config, {DOMAIN: [CONF_DOWNLOAD_DIR]}, logger):
return False
download_path = config[DOMAIN][CONF_DOWNLOAD_DIR]
# If path is relative, we assume relative to HASS config dir
if not os.path.isabs(download_path):
download_path = hass.config.path(download_path)
if not os.path.isdir(download_path):
logger.error(
+155
View File
@@ -0,0 +1,155 @@
"""
homeassistant.components.ecobee
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ecobee Component
This component adds support for Ecobee3 Wireless Thermostats.
You will need to setup developer access to your thermostat,
and create and API key on the ecobee website.
The first time you run this component you will see a configuration
component card in Home Assistant. This card will contain a PIN code
that you will need to use to authorize access to your thermostat. You
can do this at https://www.ecobee.com/consumerportal/index.html
Click My Apps, Add application, Enter Pin and click Authorize.
After authorizing the application click the button in the configuration
card. Now your thermostat and sensors should shown in home-assistant.
You can use the optional hold_temp parameter to set whether or not holds
are set indefintely or until the next scheduled event.
ecobee:
api_key: asdfasdfasdfasdfasdfaasdfasdfasdfasdf
hold_temp: True
"""
from datetime import timedelta
import logging
import os
from homeassistant.loader import get_component
from homeassistant import bootstrap
from homeassistant.util import Throttle
from homeassistant.const import (
EVENT_PLATFORM_DISCOVERED, ATTR_SERVICE, ATTR_DISCOVERED, CONF_API_KEY)
DOMAIN = "ecobee"
DISCOVER_THERMOSTAT = "ecobee.thermostat"
DISCOVER_SENSORS = "ecobee.sensor"
NETWORK = None
HOLD_TEMP = 'hold_temp'
REQUIREMENTS = [
'https://github.com/nkgilley/python-ecobee-api/archive/'
'92a2f330cbaf601d0618456fdd97e5a8c42c1c47.zip#python-ecobee==0.0.4']
_LOGGER = logging.getLogger(__name__)
ECOBEE_CONFIG_FILE = 'ecobee.conf'
_CONFIGURING = {}
# Return cached results if last scan was less then this time ago
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=180)
def request_configuration(network, hass, config):
""" Request configuration steps from the user. """
configurator = get_component('configurator')
if 'ecobee' in _CONFIGURING:
configurator.notify_errors(
_CONFIGURING['ecobee'], "Failed to register, please try again.")
return
# pylint: disable=unused-argument
def ecobee_configuration_callback(callback_data):
""" Actions to do when our configuration callback is called. """
network.request_tokens()
network.update()
setup_ecobee(hass, network, config)
_CONFIGURING['ecobee'] = configurator.request_config(
hass, "Ecobee", ecobee_configuration_callback,
description=(
'Please authorize this app at https://www.ecobee.com/consumer'
'portal/index.html with pin code: ' + network.pin),
description_image="/static/images/config_ecobee_thermostat.png",
submit_caption="I have authorized the app."
)
def setup_ecobee(hass, network, config):
""" Setup ecobee thermostat """
# If ecobee has a PIN then it needs to be configured.
if network.pin is not None:
request_configuration(network, hass, config)
return
if 'ecobee' in _CONFIGURING:
configurator = get_component('configurator')
configurator.request_done(_CONFIGURING.pop('ecobee'))
# Ensure component is loaded
bootstrap.setup_component(hass, 'thermostat', config)
bootstrap.setup_component(hass, 'sensor', config)
hold_temp = config[DOMAIN].get(HOLD_TEMP, False)
# Fire thermostat discovery event
hass.bus.fire(EVENT_PLATFORM_DISCOVERED, {
ATTR_SERVICE: DISCOVER_THERMOSTAT,
ATTR_DISCOVERED: {'hold_temp': hold_temp}
})
# Fire sensor discovery event
hass.bus.fire(EVENT_PLATFORM_DISCOVERED, {
ATTR_SERVICE: DISCOVER_SENSORS,
ATTR_DISCOVERED: {}
})
# pylint: disable=too-few-public-methods
class EcobeeData(object):
""" Gets the latest data and update the states. """
def __init__(self, config_file):
from pyecobee import Ecobee
self.ecobee = Ecobee(config_file)
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self):
""" Get the latest data from pyecobee. """
self.ecobee.update()
_LOGGER.info("ecobee data updated successfully.")
def setup(hass, config):
"""
Setup Ecobee.
Will automatically load thermostat and sensor components to support
devices discovered on the network.
"""
# pylint: disable=global-statement, import-error
global NETWORK
if 'ecobee' in _CONFIGURING:
return
from pyecobee import config_from_file
# Create ecobee.conf if it doesn't exist
if not os.path.isfile(hass.config.path(ECOBEE_CONFIG_FILE)):
if config[DOMAIN].get(CONF_API_KEY) is None:
_LOGGER.error("No ecobee api_key found in config.")
return
jsonconfig = {"API_KEY": config[DOMAIN].get(CONF_API_KEY)}
config_from_file(hass.config.path(ECOBEE_CONFIG_FILE), jsonconfig)
NETWORK = EcobeeData(hass.config.path(ECOBEE_CONFIG_FILE))
setup_ecobee(hass, NETWORK.ecobee, config)
return True
+41 -11
View File
@@ -8,7 +8,7 @@ import re
import os
import logging
from . import version
from . import version, mdi_version
import homeassistant.util as util
from homeassistant.const import URL_ROOT, HTTP_OK
@@ -19,10 +19,13 @@ INDEX_PATH = os.path.join(os.path.dirname(__file__), 'index.html.template')
_LOGGER = logging.getLogger(__name__)
FRONTEND_URLS = [
URL_ROOT, '/logbook', '/history', '/devService', '/devState', '/devEvent']
STATES_URL = re.compile(r'/states(/([a-zA-Z\._\-0-9/]+)|)')
URL_ROOT, '/logbook', '/history', '/map', '/devService', '/devState',
'/devEvent', '/devInfo', '/devTemplate',
re.compile(r'/states(/([a-zA-Z\._\-0-9/]+)|)'),
]
_FINGERPRINT = re.compile(r'^(\w+)-[a-z0-9]{32}\.(\w+)$', re.IGNORECASE)
def setup(hass, config):
@@ -34,7 +37,8 @@ def setup(hass, config):
for url in FRONTEND_URLS:
hass.http.register_path('GET', url, _handle_get_root, False)
hass.http.register_path('GET', STATES_URL, _handle_get_root, False)
hass.http.register_path('GET', '/service_worker.js',
_handle_get_service_worker, False)
# Static files
hass.http.register_path(
@@ -43,13 +47,15 @@ def setup(hass, config):
hass.http.register_path(
'HEAD', re.compile(r'/static/(?P<file>[a-zA-Z\._\-0-9/]+)'),
_handle_get_static, False)
hass.http.register_path(
'GET', re.compile(r'/local/(?P<file>[a-zA-Z\._\-0-9/]+)'),
_handle_get_local, False)
return True
def _handle_get_root(handler, path_match, data):
""" Renders the debug interface. """
""" Renders the frontend. """
handler.send_response(HTTP_OK)
handler.send_header('Content-type', 'text/html; charset=utf-8')
handler.end_headers()
@@ -60,7 +66,7 @@ def _handle_get_root(handler, path_match, data):
app_url = "frontend-{}.html".format(version.VERSION)
# auto login if no password was set, else check api_password param
auth = ('no_password_set' if handler.server.no_password_set
auth = ('no_password_set' if handler.server.api_password is None
else data.get('api_password', ''))
with open(INDEX_PATH) as template_file:
@@ -68,18 +74,42 @@ def _handle_get_root(handler, path_match, data):
template_html = template_html.replace('{{ app_url }}', app_url)
template_html = template_html.replace('{{ auth }}', auth)
template_html = template_html.replace('{{ icons }}', mdi_version.VERSION)
handler.wfile.write(template_html.encode("UTF-8"))
def _handle_get_service_worker(handler, path_match, data):
""" Returns service worker for the frontend. """
if handler.server.development:
sw_path = "home-assistant-polymer/build/service_worker.js"
else:
sw_path = "service_worker.js"
handler.write_file(os.path.join(os.path.dirname(__file__), 'www_static',
sw_path))
def _handle_get_static(handler, path_match, data):
""" Returns a static file for the frontend. """
req_file = util.sanitize_path(path_match.group('file'))
# Strip md5 hash out of frontend filename
if re.match(r'^frontend-[A-Za-z0-9]{32}\.html$', req_file):
req_file = "frontend.html"
# Strip md5 hash out
fingerprinted = _FINGERPRINT.match(req_file)
if fingerprinted:
req_file = "{}.{}".format(*fingerprinted.groups())
path = os.path.join(os.path.dirname(__file__), 'www_static', req_file)
handler.write_file(path)
def _handle_get_local(handler, path_match, data):
"""
Returns a static file from the hass.config.path/www for the frontend.
"""
req_file = util.sanitize_path(path_match.group('file'))
path = handler.server.hass.config.path('www', req_file)
handler.write_file(path)
@@ -1,22 +1,19 @@
<!doctype html>
<html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Home Assistant</title>
<link rel='manifest' href='/static/manifest.json' />
<link rel='shortcut icon' href='/static/favicon.ico' />
<link rel='icon' type='image/png'
href='/static/favicon-192x192.png' sizes='192x192'>
<link rel='manifest' href='/static/manifest.json'>
<link rel='icon' href='/static/favicon.ico'>
<link rel='apple-touch-icon' sizes='180x180'
href='/static/favicon-apple-180x180.png'>
href='/static/favicon-apple-180x180.png'>
<meta name='apple-mobile-web-app-capable' content='yes'>
<meta name='mobile-web-app-capable' content='yes'>
<meta name='viewport' content='width=device-width,
user-scalable=no' />
<meta name='viewport' content='width=device-width, user-scalable=no'>
<meta name='theme-color' content='#03a9f4'>
<style>
#init {
#ha-init-skeleton {
display: -webkit-flex;
display: flex;
-webkit-flex-direction: column;
@@ -26,26 +23,29 @@
justify-content: center;
align-items: center;
text-align: center;
font-family: 'Roboto', 'Noto', sans-serif;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
#init div {
line-height: 34px;
margin-bottom: 89px;
margin-bottom: 123px;
}
</style>
<link rel='import' href='/static/{{ app_url }}' async>
</head>
<body fullbleed>
<div id='init'>
<img src='/static/splash.png' height='230' />
<div>Initializing</div>
</div>
<script src='/static/webcomponents-lite.min.js'></script>
<link rel='import' href='/static/{{ app_url }}' />
<home-assistant auth='{{ auth }}'></home-assistant>
<div id='ha-init-skeleton'><img src='/static/favicon-192x192.png' height='192'></div>
<script>
var webComponentsSupported = ('registerElement' in document &&
'import' in document.createElement('link') &&
'content' in document.createElement('template'))
if (!webComponentsSupported) {
var script = document.createElement('script')
script.async = true
script.src = '/static/webcomponents-lite.min.js'
document.head.appendChild(script)
}
</script>
<home-assistant auth='{{ auth }}' icons='{{ icons }}'></home-assistant>
</body>
</html>
@@ -0,0 +1,2 @@
""" DO NOT MODIFY. Auto-generated by update_mdi script """
VERSION = "a1a203680639ff1abcc7b68cdb29c57a"
+1 -1
View File
@@ -1,2 +1,2 @@
""" DO NOT MODIFY. Auto-generated by build_frontend script """
VERSION = "35ecb5457a9ff0f4142c2605b53eb843"
VERSION = "833d09737fec24f9219efae87c5bfd2a"
Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 797 B

@@ -3,12 +3,17 @@
"short_name": "Assistant",
"start_url": "/",
"display": "standalone",
"theme_color": "#03A9F4",
"icons": [
{
"src": "\/static\/favicon-192x192.png",
"src": "/static/favicon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
"type": "image/png",
},
{
"src": "/static/favicon-384x384.png",
"sizes": "384x384",
"type": "image/png",
}
]
}

Some files were not shown because too many files have changed in this diff Show More