Commit Graph

46 Commits (e15eda3aa26bad430a437b4efb42d7efa4472784)

Author SHA1 Message Date
Allen Porter 1dc99ebc05
Add reauthentication support for Rainbird (#131434)
* Add reauthentication support for Rainbird

* Add test coverage for getting the password wrong on reauth

* Improve the reauth test
2024-11-24 19:33:19 +01:00
epenet 86f7718c1f
Adjust type hints for unnecessary returns in tests (#121657) 2024-07-10 09:30:50 +02:00
Marc Mueller f11b316dac
Import Generator from collections.abc (4) (#120917) 2024-07-01 11:54:42 +02:00
Sid 721b2c2ca8
Enable Ruff PT012 (#113957) 2024-06-08 17:59:08 +02:00
Marc Mueller 7195a21126
Fix Generator annotations in tests (2) (#119019) 2024-06-07 08:34:38 +02:00
Marc Mueller 837ee7c4fb
Import Generator from typing_extensions (4) (#118992) 2024-06-06 17:41:37 +02:00
epenet fdec1b0b16
Add type hints for ClientSessionGenerator in test fixtures (#118689) 2024-06-03 10:19:49 +02:00
epenet 461ac1e0bc
Add ClientSessionGenerator type hints in tests (#118377) 2024-05-29 14:49:14 +02:00
epenet 8d8696075b
Use registry fixtures in tests (r) (#118293) 2024-05-28 14:23:31 +02:00
Marc Mueller 1ad8151bd1
Use PEP 695 type alias in tests (#117797) 2024-05-20 19:03:04 +02:00
J. Nick Koston 5a609c34bb
Fix blocking I/O in the event loop when loading timezones (#117721) 2024-05-20 11:06:03 +02:00
Sid e662e3b65c
Bump ruff to 0.4.2 (#116201)
* Bump ruff to 0.4.2

* review comments
2024-04-26 08:48:32 +02:00
Allen Porter c7cb0237d1
Fix bug in rainbird switch when turning off a switch that is already off (#115421)
Fix big in rainbird switch when turning off a switch that is already off

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-04-11 22:14:52 -04:00
epenet 9204ccfa17
Use is in ConfigEntryState enum comparison in tests (N-Z) (#114926) 2024-04-05 17:37:00 +02:00
Joost Lekkerkerker f3ba713289
Use FlowResultType enum in config flow tests N-Z (#114682)
Use FlowResultType enum in config flow tests
2024-04-03 09:53:20 +02:00
Joost Lekkerkerker ee66f6ec8c
Use is in enum comparison in config flow tests P-T (#114675) 2024-04-02 11:21:50 -10:00
Sid 304ed8bf3d
Unignore Ruff PLC in tests (#114572) 2024-04-01 21:28:54 +02:00
Joost Lekkerkerker 6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Marc Mueller aa16a9d707
Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
Joost Lekkerkerker d811125eb7
Add icon translations to Rainbird (#112200)
* Add icon translations to Rainbird

* Add icon translations to Rainbird
2024-03-04 15:26:41 +01:00
Allen Porter 5cb5a1141f
Limit rainbird aiohttp client session to a single connection (#112146)
Limit rainbird to a single open http connection
2024-03-03 19:54:05 -05:00
Allen Porter 261f9c5d62
Cleanup test config entry setup to use best practices (#110070)
* Cleanup test config entry setup to use best practices

* Add missed files
2024-02-08 19:52:40 -08:00
Marc Mueller 438d3b01b9
Use builtin TimeoutError [o-s] (#109682) 2024-02-05 12:14:37 +01:00
Ville Skyttä 24b1e01d71
Update Ruff to 0.1.8, avoid linter/formatter conflicts (#106080)
* Disable Ruff rules that may conflict with the formatter

* Upgrade Ruff to 0.1.8

- https://github.com/astral-sh/ruff/releases/tag/v0.1.7
- https://github.com/astral-sh/ruff/releases/tag/v0.1.8

* Format with Ruff 0.1.8
2023-12-20 23:55:09 +01:00
Allen Porter c72e4e8b5c
Fix bug in rainbird device ids that are int serial numbers (#104768) 2023-11-30 06:11:38 +01:00
Allen Porter 664aca2c68
Fix rainbird duplicate devices (#104528)
* Repair duplicate devices added to the rainbird integration

* Apply suggestions from code review

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

* Update tests/components/rainbird/test_init.py

* Remove use of config_entry.async_setup

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-11-27 07:43:03 -08:00
Aarni Koskela 706add4a57
Switch formatting from black to ruff-format (#102893)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-11-27 14:38:59 +01:00
Allen Porter 25650563fe
Fix Rainbird unique to use a more reliable source (mac address) (#101603)
* Fix rainbird unique id to use a mac address for new entries

* Fix typo

* Normalize mac address before using as unique id

* Apply suggestions from code review

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

* Update test check and remove dead code

* Update all config entries to the new format

* Update config entry tests for migration

* Fix rainbird entity unique ids

* Add test coverage for repair failure

* Apply suggestions from code review

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

* Apply suggestions from code review

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

* Remove unnecessary migration failure checks

* Remove invalid config entries

* Update entry when entering a different hostname for an existing host.

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-11-12 08:36:30 +01:00
Allen Porter e8c568a243
Remove rainbird yaml config test fixtures (#103607) 2023-11-07 23:24:34 +01:00
Allen Porter 8c2a2e5c37
Additional fix for rainbird unique id (#101599)
Additiona fix for rainbird unique id
2023-10-07 10:17:08 -07:00
Allen Porter 920bd04099
Fix for rainbird unique id (#101512) 2023-10-06 09:16:06 +02:00
Allen Porter 2d58ab0e1c
Fix rainbird entity unique ids (#101168)
* Fix unique ids for rainbird entities

* Update entity unique id use based on config entry entity id

* Update tests/components/rainbird/test_binary_sensor.py

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

* Rename all entity_registry variables

* Shorten long comment under line length limits

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-10-01 08:12:44 -07:00
Allen Porter fa2d77407a
Add Rain Bird irrigation calendar (#87604)
* Initial version of a calendar for the rainbird integration

* Improve calendar support

* Revert changes to test fixtures

* Address ruff error

* Fix background task scheduling

* Use pytest.mark.freezetime to move to test setup

* Address PR feedback

* Make refresh a member

* Merge rainbird and calendar changes

* Increase test coverage

* Readability improvements

* Simplify timezone handling
2023-09-25 20:27:38 -04:00
Allen Porter 8d8c7187d3
Fix rainbird unique id (#99704)
* Don't set a unique id for devices with no serial

* Add additional check for the same config entry host/port when there is no serial

* Update homeassistant/components/rainbird/config_flow.py

Co-authored-by: Robert Resch <robert@resch.dev>

* Update tests/components/rainbird/test_config_flow.py

Co-authored-by: Robert Resch <robert@resch.dev>

* Update tests/components/rainbird/test_config_flow.py

Co-authored-by: Robert Resch <robert@resch.dev>

---------

Co-authored-by: Robert Resch <robert@resch.dev>
2023-09-23 23:14:57 +02:00
Marc Mueller 063ce9159d
Use asyncio.timeout [o-s] (#98451) 2023-08-15 17:21:49 +02:00
Allen Porter 9ddf11f6cd
Improve rainbird error handling (#98239) 2023-08-14 13:32:08 +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
Allen Porter 32b3fa1734
Enable retries on rainbird devices by loading model and version (#96190)
Update rainbird to load device model and version
2023-07-09 16:49:44 -07:00
Joost Lekkerkerker d2bcb5fa87
Add entity translations to Rainbird (#96030)
* Add entity translations to Rainbird

* Add entity translations to Rainbird
2023-07-06 16:03:01 -07:00
G Johansson e41a75f617
Remove yaml import rainbird (#92599) 2023-05-05 16:53:40 +02:00
G Johansson 835be4758a
Remove deprecated service for rainbird (#92601) 2023-05-05 07:22:07 -07:00
Franck Nijhof ed79265843
Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
Franck Nijhof 6551eb168d
Add common area, device, entity and issue registry test fixtures (#87694) 2023-02-08 16:28:44 +01:00
Allen Porter 09891ead8d
Add rainbird rain delay number entity, deprecating the sensor and service (#86208)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-24 21:16:52 +01:00
Allen Porter 5000c426c6
Add config flow for Rain Bird (#85271)
* Rainbird config flow

Convert rainbird to a config flow. Still need to handle irrigation numbers.

* Add options for irrigation time and deprecate yaml

* Combine exception handling paths to get 100% test coverage

* Bump the rainird config deprecation release

* Apply suggestions from code review

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

* Remove unnecessary sensor/binary sensor and address some PR feedback

* Simplify configuration flow and options based on PR feedback

* Consolidate data update coordinators to simplify overall integration

* Fix type error on python3.9

* Handle yaml name import

* Fix naming import post serialization

* Parallelize requests to the device

* Complete conversion to entity service

* Update homeassistant/components/rainbird/switch.py

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

* Update homeassistant/components/rainbird/config_flow.py

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

* Remove unused import

* Set default duration in options used in tests

* Add separate devices for each sprinkler zone and update service to use config entry

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-07 09:34:01 -08:00
Allen Porter 490d2cfb71
Move Rainbird to async client library (#84417)
* Bump pyrainbird to 0.7.0 and move to async library

* Share updates across sensors

* Fix test version and delete dead code

* Add test coverage for yaml configuration

* Address PR feedback
2022-12-22 13:00:17 -08:00