Commit Graph

10 Commits (9c84c2889f7a393b48905f99412c7def3f24efdb)

Author SHA1 Message Date
Maciej Bieniek c9178e58b5
Add support for state class for Airly sensor (#51285) 2021-05-31 16:00:58 +02:00
Maciej Bieniek 3bdefc5da7
Use constants with TypedDict (#50879) 2021-05-20 10:34:32 +01:00
Maciej Bieniek 6df0190aeb
Improve type annotations for Airly integration (#49898) 2021-05-07 09:47:52 -05:00
Maciej Bieniek 513685bbea
Add dynamic update interval to Airly integration (#47505)
* Add dynamic update interval

* Update tests

* Improve tests

* Improve comments

* Add MAX_UPDATE_INTERVAL

* Suggested change

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Use async_fire_time_changed to test update interval

* Fix test_update_interval

* Patch dt_util in airly integration

* Cleaning

* Use total_seconds instead of seconds

* Fix update interval test

* Refactor update interval test

* Don't create new context manager

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-04-27 23:34:53 +02:00
Yuval Aboulafia 2a0c36589f
Centralize some Airly constants (#45985) 2021-02-05 12:41:36 +01:00
Maciej Bieniek 2e50c1be8e
Add nearest method to get data for Airly integration (#44288)
* Add nearest method

* Add tests

* Move urls to consts

* Simplify config flow

* Fix tests

* Update tests

* Use in instead get

* Fix AirlyError message in tests

* Fix manual update entity tests

* Clean up tests

* Fix after rebase

* Increase test coverage

* Format the code

* Fix after rebase
2021-01-04 23:14:45 +01:00
Maciej Bieniek 8258dcf41d
Add device_info property and simplify generation of unique_id for Airly integration (#38479) 2020-08-05 12:55:14 +02:00
Maciej Bieniek 16670a38a4
Dynamic update interval for Airly integration (#31459)
* Initial commit

* dynamic update

* Don't update when add entities

* Cleaning

* Fix MAX_REQUESTS_PER_DAY const

* Fix pylint errors

* Fix comment

* Migrate to DataUpdateCoordinator

* Cleaning

* Suggested change

* Change try..except as suggested

* Remove unnecessary self._attrs variable

* Cleaning

* Fix typo

* Change update_interval method

* Add comments

* Add ConfigEntryNotReady
2020-03-25 11:13:28 -07:00
Maciej Bieniek ec78821161 Add sensor platform to Airly integration (#27717)
* Add sesnor.py file

* Move AirlyData to __init__

* Cleaning

* Update .coveragerc file

* Sort consts

* Sort imports

* Remove icons from sensors with device_class
2019-10-16 12:06:52 +02:00
Maciej Bieniek 8ba4ee1012 Add Airly integration (#26375)
* Add Airly integration

* Update .coveragerc file

* Remove AVAILABLE_CONDITIONS and fix device_class

* Don't create client on every update

* Rename client to session

* Rename state_attributes to device_state_attributes

* Remove log latitude and longitude

* Fix try...except

* Change latitude and longitude to HA defaults

* _show_config_form doesn't need coroutine

* Simplify config_flow errors handlig

* Preetier

* Remove unnecessary condition

* Change sensor platform to air_quality

* Remove PM1

* Make unique_id more unique

* Remove ,

* Add tests for config_flow

* Move conf to CONFIG

* Remove domain from unique_id

* Change the way update of attrs

* Language and attrs

* Fix attrs

* Add aiohttp error handling

* Throttle as decorator

* Suggested change

* Suggested change

* Invert condition

* Cleaning

* Add tests

* Polish no sesnor error handling

* Better strings

* Fix test_invalid_api_key

* Fix documentation url

* Remove unnecessary test

* Remove language option

* Fix test_invalid_api_key once again

* Sort imports

* Remove splits in strings
2019-10-04 13:58:29 +02:00