Commit graph

44 commits

Author SHA1 Message Date
Marcelo Moreira de Mello
4fb0b27310 Wunderground sensor with alerts exceeds API limits (#4070)
* Fixes issue #4067 - Wunderground sensor with alerts exceeds API limits

 To avoid hitting the max limit of 500 calls per day, this patch keeps weather conditions being updated each 5 minutes
  and weather advisories each 15 minutes.

 This formula will result the following:

   conditions -> 300 seconds -> 5 minutes -> 12 req/h -> 288 req/day
   alerts -> 900 seconds -> 15 minutes -> 4 req/h -> 96 req/day

* Using timedelta in minutes instead seconds
2016-10-26 23:31:49 -07:00
Marcelo Moreira de Mello
1f468fc94d If no weather advisories were issued, state should return 0 instead Unknown (#4029)
* If no weather advisories were issued, state should return 0 instead Unknown

* Updated to keep on the same if statement

* Revert "Updated to keep on the same if statement"

This reverts commit 0e6a94aa0f.
2016-10-25 22:49:51 -07:00
Marcelo Moreira de Mello
6fcb1b548e Added the ability to Weather Underground to track severe weather alerts (#3505)
*  Added the ability to Weather Underground to track severe weather alerts

*   * Added message on the advisory attr

  * Updated tests

* * Making use of guard clause

* Checking multiple_alerts prior loop

* Using a better way to create dict

* Fixed issue to set to None only the object that failed

* Added unittest

* Split update() method to different calls with their one throttle control to minimize API calls

* Updated unittest and make sure the alert sensor will not return 'unknown' status'

* Removed update() method from state property

* Branch rebased and include Weather Underground attribution

* Update wunderground.py
2016-10-14 21:35:27 -07:00
Fabian Affolter
8ded8f572a Add/adjust attribution of sensor platform (#3719)
* Add/adjust attribution

* Fix typo
2016-10-11 00:28:19 -07:00
arsaboo
39402aff2e Remove units for humidity in Wundeground sensor (#3018)
* Remove units for humidity

Wunderground returns the information with the units.

* Trim the % from the return value of humidity
2016-08-28 21:05:28 -06:00
Fabian Affolter
e8c6e4d561 Clean-up, ordering, constants, and extend of schema (#2903)
* Clean-up, ordering, constants, and extend of schema

* Put REQUIREMENTS back and re-add line breaks

* Clean-up, ordering, constants, and extend of schema

* Extend platform
2016-08-20 15:40:16 -07:00
Teagan M. Glenn
5bdcf60a21 Extend platform schema 2016-08-18 10:47:52 -06:00
Teagan M. Glenn
90449a90f1 Use string templating 2016-08-18 10:46:24 -06:00
Teagan M. Glenn
25840f97c2 Consistent use of WUnderground 2016-08-18 10:46:04 -06:00
Teagan M. Glenn
c2b75140bf Fix config validation import to make things more readable 2016-08-18 10:40:28 -06:00
Teagan M. Glenn
ec5e20f0d9 Use string constant 2016-08-18 10:38:34 -06:00
Teagan M. Glenn
db2d9ec854 Unused property 2016-08-18 10:37:39 -06:00
Teagan M. Glenn
ddec28da4b Use schema validators already avaialble 2016-08-18 10:37:26 -06:00
Teagan M. Glenn
6f57d36134 Add doc link to header of file 2016-08-18 10:37:00 -06:00
Teagan M. Glenn
0490fe832a Unneeded validation removed 2016-08-18 10:32:19 -06:00
arsaboo
230dde4b57 Removed blank line (linting error) 2016-08-18 10:12:56 -04:00
arsaboo
90fdc89838 Updated to address @balloob's comments 2016-08-18 09:59:41 -04:00
Teagan M. Glenn
4e586c18ff Check for error and pull obvservation 2016-08-17 22:32:42 -06:00
Teagan M. Glenn
87f81bf3b4 Use url builder helper 2016-08-17 22:32:19 -06:00
Teagan M. Glenn
d2ba8ee0a7 Reraise exception 2016-08-17 22:31:58 -06:00
Teagan M. Glenn
466dd35f3d Don't set state on update - state already handles this 2016-08-17 22:31:47 -06:00
Teagan M. Glenn
e54ba5ff72 No need no need to set variable 2016-08-17 22:31:28 -06:00
Teagan M. Glenn
dd14f90afb Error handling on state 2016-08-17 22:30:23 -06:00
Teagan M. Glenn
ecb4eb843b Don't call update on init of sensor 2016-08-17 22:30:03 -06:00
Teagan M. Glenn
afef255a25 Condition is already a string 2016-08-17 22:29:49 -06:00
Teagan M. Glenn
417711d665 Refactoring 2016-08-17 22:29:37 -06:00
Teagan M. Glenn
31237a891c Catch exception from update on initial platform setup 2016-08-17 22:29:25 -06:00
Teagan M. Glenn
62b00e1294 Update invocation of WUndergroundData 2016-08-17 22:29:00 -06:00
Teagan M. Glenn
563154c3c2 Validate configuration 2016-08-17 22:28:18 -06:00
Teagan M. Glenn
1a8e17ce41 Pass hass to constructor 2016-08-17 22:28:05 -06:00
Teagan M. Glenn
42caa31067 Unused variable 2016-08-17 22:22:29 -06:00
Teagan M. Glenn
e4abecd359 Build url helper method 2016-08-17 22:22:11 -06:00
Teagan M. Glenn
53b97feb3c Rename constant - make valid for lat/long too 2016-08-17 22:20:22 -06:00
Teagan M. Glenn
a09baf1d5a Not using payload 2016-08-17 22:19:57 -06:00
Teagan M. Glenn
b7809675eb Config schema 2016-08-17 22:19:13 -06:00
Teagan M. Glenn
333e3ba822 Add imports 2016-08-17 22:18:37 -06:00
arsaboo
a0bcd33b71 Update wunderground.py 2016-08-17 17:48:37 -04:00
arsaboo
be57cd55c5 Update wunderground.py 2016-08-17 17:25:42 -04:00
arsaboo
4dff42e8bb Update wunderground.py 2016-08-17 17:04:11 -04:00
arsaboo
75cd1f8063 Update wunderground.py 2016-08-17 16:50:32 -04:00
arsaboo
fae9267701 Update wunderground.py 2016-08-17 16:41:22 -04:00
arsaboo
1a34bc5301 Removed lynting issues 2016-08-17 16:31:36 -04:00
arsaboo
aabeda2b60 Update wunderground.py 2016-08-17 16:15:07 -04:00
arsaboo
469d095827 Create initial Wunderground weather sensor 2016-08-17 15:06:12 -04:00