1
mirror of https://github.com/home-assistant/core synced 2024-09-12 15:16:21 +02:00
Commit Graph

29 Commits

Author SHA1 Message Date
Jan-Philipp Benecke
5d46e22591
Move airly coordinator to its own file (#99545) 2023-09-11 21:52:02 -05:00
J. Nick Koston
262483f3f6
Replace async_timeout with asyncio.timeout A-B (#98415) 2023-08-15 10:29:28 +02:00
Erik Montnemery
7539cf25be
Don't require passing identifiers to DeviceRegistry.async_get_device (#96479)
* Require keyword arguments to DeviceRegistry.async_get_device

* Update tests

* Update tests

* Don't enforce keyword arguments
2023-07-13 13:39:25 -04:00
Franck Nijhof
ca1a12898c
Enable Ruff D212 (#87347) 2023-02-03 23:08:48 +01:00
Maciej Bieniek
cc016c9bba
Pass language to the Airly API (#85655)
* Pass language to the API

* Pass only pl or en

* Add comment
2023-01-12 16:15:00 +01:00
J. Nick Koston
cd03c49fc2
Wait for config entry platform forwards (#73806) 2022-07-09 17:27:42 +02:00
epenet
0cea2eba84
Cleanup deprecated async_get_registry in airly (#72061) 2022-05-18 13:15:28 +02:00
Marc Mueller
f57d42a9e8
Use platform enum (1) [A-D] (#60908)
* Use platform enum (1) [A-D]

* Fix imports

* Fix tests

* Use Platform even in tests
2021-12-03 08:51:30 -08:00
J. Nick Koston
10d6247fee
Bump to aiohttp 3.8.0 (#58974) 2021-11-04 10:07:50 -05:00
Maciej Bieniek
3d556f14a5
Remove air_quality platform from Airly integration (#52225)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-06-28 10:15:56 +02:00
Shay Levy
cf228e3fe5
Add constructor return type in integrations A-D (#50903) 2021-05-20 18:51:39 +03:00
Ville Skyttä
b89c53f759
Type hint device registry identifiers as set of str 2-tuples (#50355)
* Type hint device registry identifiers as set of str 2-tuples

* Fix airly test

* Really fix airly test, add another migration test
2021-05-10 12:13:45 +02: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
J. Nick Koston
51be2f860a
Reduce boilerplate to setup config entry platforms A-C (#49681)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-26 07:46:55 -10:00
Franck Nijhof
8393a215e9
Clean up superfluous integration setup - part 1 (#48476) 2021-03-29 13:22:33 -10:00
J. Nick Koston
a851bff95a
Create async_config_entry_first_refresh to reduce coordinator boilerplate (#48451) 2021-03-29 12:51:39 -10:00
Quentame
198ecb0945
Uniformize platform setup (#47101)
* A platform is not a component

* Fix dynalite

* SUPPORTED_PLATFORMS --> PLATFORMS

* In tests

* In tests 2

* Fix SmartThings

* Fix ZHA test

* Fix Z-Wave

* Revert Z-Wave

* Use PLATFORMS const in ambient_station

* Fix ihc comment
2021-03-02 21:43:59 +01:00
Maciej Bieniek
66027bcef5
Bump airly library to version 1.1.0 (#47163) 2021-02-28 12:53:13 +01: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
Ville Skyttä
b4bac0f7a0
Exception chaining and wrapping improvements (#39320)
* Remove unnecessary exception re-wraps

* Preserve exception chains on re-raise

We slap "from cause" to almost all possible cases here. In some cases it
could conceivably be better to do "from None" if we really want to hide
the cause. However those should be in the minority, and "from cause"
should be an improvement over the corresponding raise without a "from"
in all cases anyway.

The only case where we raise from None here is in plex, where the
exception for an original invalid SSL cert is not the root cause for
failure to validate a newly fetched one.

Follow local convention on exception variable names if there is a
consistent one, otherwise `err` to match with majority of codebase.

* Fix mistaken re-wrap in homematicip_cloud/hap.py

Missed the difference between HmipConnectionError and
HmipcConnectionError.

* Do not hide original error on plex new cert validation error

Original is not the cause for the new one, but showing old in the
traceback is useful nevertheless.
2020-08-28 13:50:32 +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
15645ab0c9 Add unique ID to Airly config entries (#30681)
* Add unique ID to Airly config entries

* Update tests

* Update tests

* Fix typo

* Remove unnecesary and undo changes in first test

* Suggested change
2020-01-13 13:28:07 +01:00
Maciej Bieniek
80be3b74a9 Init entities as unavailable when offline (#29738) 2019-12-19 14:10:27 +01:00
Maciej Bieniek
4e40394972 Fix Airly if more than one config entry (#28498) 2019-11-04 00:58:35 +01:00
Maciej Bieniek
d133501735 Fix Airly asyncio timeout error (#28387)
* Raise ConfigEntryNotReady

* Better asyncio.TimeoutError handling

* Sort imports

* Increase asyncio timeout
2019-10-31 09:29:27 -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