Commit Graph

61 Commits (0b6f2f5b9133d946f1ae50a085f612858c729c34)

Author SHA1 Message Date
Ville Skyttä 2f7b79764a More pylint 2 fixes (#15565)
## Description:

More fixes flagged by pylint 2 that don't hurt to have before the actual pylint 2 upgrade (which I'll submit soon).

## Checklist:
  - [ ] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
2018-07-20 11:45:20 +03:00
Ville Skyttä b92350fb55 Lint cleanup (#15103)
* Remove unneeded inline pylint disables

* Remove unneeded noqa's

* Use symbol names instead of message ids in inline pylint disables
2018-06-25 13:05:07 -04:00
Daniel Høyer Iversen eaba3b315c Reduce the load on met.no servers, yr.no sensor (#12435)
* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* fix comment

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Update yr.py
2018-02-17 13:33:41 -08:00
Otto Winter 678f284015 Upgrade pylint to 1.8.2 (#12274)
* Upgrade pylint to 1.8.1

* Fix no-else-return

* Fix bad-whitespace

* Fix too-many-nested-blocks

* Fix raising-format-tuple

See https://github.com/PyCQA/pylint/blob/master/doc/whatsnew/1.8.rst

* Fix len-as-condition

* Fix logging-not-lazy

Not sure about that TEMP_CELSIUS though, but internally it's probably just like if you concatenated any other (variable) string

* Fix stop-iteration-return

* Fix useless-super-delegation

* Fix trailing-comma-tuple

Both of these seem to simply be bugs:
 * Nest: The value of self._humidity never seems to be used anywhere
 * Dovado: The called API method seems to expect a "normal" number

* Fix redefined-argument-from-local

* Fix consider-using-enumerate

* Fix wrong-import-order

* Fix arguments-differ

* Fix missed no-else-return

* Fix no-member and related

* Fix signatures-differ

* Revert "Upgrade pylint to 1.8.1"

This reverts commit af78aa00f125a7d34add97b9d50c14db48412211.

* Fix arguments-differ

* except for device_tracker

* Cleanup

* Fix test using positional argument

* Fix line too long

I forgot to run flake8 - shame on me... 🙃

* Fix bad-option-value for 1.6.5

* Fix arguments-differ for device_tracker

* Upgrade pylint to 1.8.2

* 👕 Fix missed no-member
2018-02-11 09:20:28 -08:00
Andrey 273db75248 Always load yr picture from https (#11796) 2018-01-19 13:06:34 +01:00
Fabian Affolter 39131d06ba Improvements (configuration and validation) (#8785) 2017-08-02 14:51:09 +02:00
Lukas Barth 47dad547eb Add 'forecast' ability to yr weather sensor (#8650)
* Add forecast option to YR sensor

* Fix some style issues

* Fix linting
2017-08-01 22:42:51 -07:00
Fabian Affolter a4f1f6e724 Update docstrings (#7374)
* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstring

* Update docstrings

* Update docstrings

* Fix lint issues

* Update docstrings

* Revert changes in dict
2017-05-02 09:18:47 -07:00
Fabian Affolter 74362df19c Upgrade xmltodict to 0.11.0 (#7355) 2017-04-29 23:59:38 +02:00
Paulus Schoutsen 714b516176 aiohttp 2 (#6835)
* Upgrade aiohttp2

* Fix resource caching

* Fix helpers.aiohttp_client

* Lint

* Use static path for api error_log

* Fix ClientErrors import

* Remove not needed DisconnectError

* Remove releasing responses code

* Add timeout if stream starts non responding

* More async_aiohttp_proxy_stream cleanup

* Fix references to ClientError

* Fix fingerprinting

* Fix aiohttp stream tests

* Rename aiohttp_proxy_stream

* Remove impossible darksky test

* Fix sleepiq requests escaping mocker

* Lint

* Remove deprecated parameter

* Break up aiohttp_proxy_stream in 2 methods

* Lint

* Upgrade to aiohttp 2.0.4

* Convert connector close to a callback

* Fix static fingerprinted links
2017-03-30 00:50:53 -07:00
Pascal Vizeli 41f558b181 Bootstrap / Component setup async (#6264)
* Bootstrap / Entiy setup async

* Cleanup add_job stuff / return task/future object

* Address paulus comments / part 1

* fix install pip

* Cleanup bootstrap / move config stuff to config.py

* Make demo async

* Further bootstrap improvement

* Address Martin's comments

* Fix initial tests

* Fix final tests

* Fix bug with prepare loader

* Remove no longer needed things

* Log error when invalid config

* More cleanup

* Cleanups platform events & fix lint

* Use a non blocking add_entities callback for platform

* Fix Autoamtion is setup befor entity is ready

* Better automation fix

* Address paulus comments

* Typo

* fix lint

* rename functions

* fix tests

* fix test

* change exceptions

* fix spell
2017-02-28 20:33:19 -08:00
Pascal Vizeli 1d7ab0fa95 Cleanup some async stuff (#6127)
* Cleanup some async stuff

* change to schedule_update_ha_state()

* fix media player

* fix zigbee
2017-02-20 13:24:03 -08:00
Daniel Høyer Iversen f669680b1e fix issue ##5398 in yr sensor (#5459) 2017-01-19 23:58:15 -08:00
Daniel Høyer Iversen 2f907696f3 [WIP] Spread the traffic to yr.no servers and remove yr.no from the default… (#5171)
* Spread the traffic to yr.no servers and remove yr.no from the default config

* use unique address for yr.no

* update yr tests

* Wait 10 min extra before requesting new data

* Update config.py

* Update yr.py
2017-01-04 23:20:30 +01:00
Johann Kellerman b170f4c399 Spread seconds (#5025) 2016-12-21 08:42:23 +01:00
Johann Kellerman c6c8cd4f51 Yr.no: New aiohttp client needs params to form websession URL (#4634)
* Yr.no: New aiohttp client needs params to form websession URL
* Support params in aiohttp mocking
2016-12-01 08:20:21 +02:00
Paulus Schoutsen e5504b39ec Close aiohttp responses (#4624)
* Close aiohttp responses

* Update generic.py
2016-11-30 13:05:58 -08:00
Pascal Vizeli cf57db919e Refactory aiohttp clientsession handling in HA (#4602)
* Refactory aiohttp clientsession handling in HA

* remove from core / update platforms / rename file
2016-11-27 16:26:46 -08:00
Johann Kellerman 0827a26642 Yr.no update entities every hour (#4521) 2016-11-22 19:28:31 -08:00
Johann Kellerman 9bb94a4512 Improve async generic camera's error handling (#4316)
* Handle errors

* Feedback

* DisconnectedError
2016-11-10 21:28:22 -08:00
Pascal Vizeli 2e0c185740 Async cleanup part 3 (#4302) 2016-11-07 22:31:40 -08:00
Paulus Schoutsen a343c20404 Async gather wait (#4247)
* Fix config validation for input_*, script

* Allow scheduling coroutines

* Validate entity ids when entity ids set by platform

* Async: gather -> wait

* Script/Group: use async_add_job instead of create_task
2016-11-06 09:26:40 -08:00
Pascal Vizeli c2a5f63b1f Bugfix async Yr.no (#4190) 2016-11-03 11:09:03 +02:00
Johann Kellerman f3595f790a Async version of Yr.no (#4158)
* initial

* feedback

* More feedback. Still need to fix match_url

* url_match

* split_lines
2016-11-02 19:34:12 -07:00
Fabian Affolter be272ac64a Disable too-many-* (#4107)
* Disable too-many-* and too-few-public-methods

* Remove globally disabled pylint warnings
2016-10-30 22:18:53 +01:00
Fabian Affolter a0fdb2778d Fix name allocation (#3890) 2016-10-16 18:07:34 +02:00
Fabian Affolter 8ded8f572a Add/adjust attribution of sensor platform (#3719)
* Add/adjust attribution

* Fix typo
2016-10-11 00:28:19 -07: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
Fabian Affolter a0c1c918b8 Switch to xmltodict and pass over missing temperature (fixes #2433) (#2463)
* Switch to xmltodict and pass over missing temperature (fixes #2433)

* Add guard clauses
2016-07-13 18:30:11 -07:00
Paulus Schoutsen 6714392e9c Move elevation to core config and clean up HTTP mocking in tests (#2378)
* Stick version numbers

* Move elevation to core config

* Migrate forecast test to requests-mock

* Migrate YR tests to requests-mock

* Add requests_mock to requirements_test.txt

* Move conf code from bootstrap to config

* More config fixes

* Fix some more issues

* Add test for set config and failing auto detect
2016-06-27 09:02:45 -07:00
Igor Shults 7afdca1121 Use protocol of web page for yr.no pictures 2016-04-23 21:09:39 -05:00
Paulus Schoutsen 68d92c3196 Use standardised datetime format 2016-04-16 01:46:50 -07:00
Daniel Høyer Iversen cd80e41b32 Allow negative elevation in yr config 2016-04-12 07:54:03 -07:00
Jan Harkes 656e187729 Some fixes for yr config validation. (#1809)
The setup_platform function is trying to get CONF_LATITUDE and CONF_LONGITUDE,
but the validation schema was not accepting these.

Also moved CONF_MONITORED_CONDITIONS and CONF_ELEVATION to homeassistant.const
because they are used in other places.
2016-04-11 21:44:39 -07:00
Daniel Høyer Iversen d3493c7e5a Config validation of yr sensor (#1767) 2016-04-10 10:43:05 -07:00
Fabian Affolter 8bff97083c Fix PEPE257 issues 2016-03-08 16:46:34 +01:00
Paulus Schoutsen 967a751da1 Add entity_picture property 2016-02-23 22:41:24 -08:00
Fabian Affolter 60d579af84 Update/add docstrings (PEP257) 2016-02-23 06:23:04 +01:00
Paulus Schoutsen e80309c03c Fix imports (using isort) 2016-02-18 21:27:50 -08:00
Paulus Schoutsen f08b77dc4c Clean up state_attributes vs device_state_attributes 2016-02-06 22:34:24 -08:00
Daniel 5005b20122 Added and fixed yr tests 2016-02-01 15:50:17 +01:00
Erik 9e7886b909 allow monitoring weather at other location than home (such as summer house) 2016-01-28 17:16:02 +01: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 a9c6f8c1d9 Enforce entity attribute types 2016-01-17 17:50:20 -08:00
Fabian Affolter 35c29dac3f Use mbar instead of hPa 2016-01-07 11:50:02 +01:00
Fabian Affolter 0d0fdb0adf Remove configuration details 2016-01-04 16:26:11 +01:00
Paulus Schoutsen c1eaf60461 VCR YR sensor test 2015-12-27 17:37:32 -08:00
Paulus Schoutsen ab5a3f9de3 Clean up YR sensor 2015-12-27 11:07:25 -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