1
0
mirror of https://github.com/home-assistant/core.git synced 2025-08-21 19:30:02 +00:00
Commit Graph

27 Commits

Author SHA1 Message Date
Joost Lekkerkerker
b9281327c4 Use FlowResultType enum in config flow tests A-M () 2024-04-03 09:21:17 +02:00
Joost Lekkerkerker
906d3198e3 Use is in enum comparison in config flow tests F-J ()
* Use right enum expression F-J

* Fix
2024-04-02 23:01:37 +02:00
Joost Lekkerkerker
6bb4e7d62c Bump ruff to 0.3.4 ()
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
c88b337600 Add empty line after module docstring [tests f-k] () 2024-03-08 14:50:04 +01:00
epenet
89e4ee5320 Add type hints to integration tests (part 8) () 2023-02-13 11:13:48 +01:00
epenet
37a2040d7b Add type hints to integration tests (h-i) () 2023-02-08 18:12:56 +01:00
Franck Nijhof
7cd68381f1 Search/replace RESULT_TYPE_* by FlowResultType enum () 2022-07-07 19:57:36 +03:00
epenet
9eed18f121 Use SsdpServiceInfo for ssdp tests (part 1) ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-25 14:35:19 +01:00
J. Nick Koston
cac0c04a91 Avoid setting up harmony websocket from discovery () 2021-10-17 20:32:02 -07:00
Paulus Schoutsen
a4d9019ffc Refactor persistent notification to no longer route all data via a service ()
* Convert persistent notification tests to async

* Create/dismiss persistent notifications in exposed functions, not service calls

* Fix notify persistent_notification

* Remove setting up persistent_notification

* Drop more setups

* Empty methods

* Undeprecate sync methods because too big task

* Fix setup clearing notifications

* Fix a bunch of tests

* Fix more tests

* Uno mas

* Test persistent notification events

* Clean up stale comment

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-07 12:58:00 +02:00
Franck Nijhof
7264c95217 Clean up superfluous integration setup - part 6 () 2021-04-16 09:23:27 -07:00
J. Nick Koston
5d7b53603f Harmony: set confirm only () 2021-03-08 15:44:55 -08:00
Maciej Bieniek
134b1d3f63 Fix entities device_info property in Harmony integration () 2021-02-04 08:16:09 -05:00
J. Nick Koston
4efe6762c4 Remove YAML support from harmony () 2021-01-14 09:45:32 +01:00
Mike Keesey
60a1948ab0 Generate switches for harmony activities automatically ()
* Adding switch code for harmony activities

* Working on-off

* Removing poll code for now

* Async updates for current activity

* Update our state based on events

* Notifications we got connected or disconnected

* Remove unncessary constructor arg

* Initial switch tests

* Additional tests for switch transitions

* Test transitions for availability

* Testing switch state changes

* Tests passing

* Final tests

* Updating manifest.

* Correctly mock the return value from a call to the library

* Adding new subscriber classes

* Update class name and location

* Got the refactor working locally.

* Tests passing

* Tracking state changes

* Remove write_to_config_file - this appears to never be read.

It was added far back in the past to account for a harmony library
change, but nothing ever reads that path.

Removing that side effect from tests is a pain - avoid the side effect
completely.

* Connection changes tested

* Clean up temporary code

* Update .coveragerc for harmony component

Specifically exclude untested files instead of the whole module

* Fix linting

* test sending activity change commands by id

* Improving coverage

* Testing channel change commands

* Splitting subscriber logic into it's own class

* Improve coverage and tighten up .coveragerc

* Test cleanups.

* re-add config file writing for harmony remote

* Create fixture for the mock harmonyclient

* Reduce duplication in subscription callbacks

* use async_run_job to call callbacks

* Adding some tests for async behaviors with subscribers.

* async_call_later for delay in marking remote unavailable

* Test disconnection handling in harmony remote

* Early exit if activity not specified

* Use connection state mixin

* Lint fix after rebase

* Fix isort

* super init for ConnectionStateMixin

* Adding @mkeesey to harmony CODEOWNERS
2021-01-04 13:21:14 -10:00
Franck Nijhof
65cf2fcb6f Drop asynctest () 2021-01-01 22:31:56 +01:00
Paulus Schoutsen
1c36bf5e19 Fix block till done in create entry config flow tests () 2020-10-24 16:20:56 +02:00
Franck Nijhof
1c2ebdf307 Upgrade black to 20.8b1 () 2020-08-27 13:56:20 +02:00
J. Nick Koston
ed104d1927 Avoid error with ignored harmony config entries () 2020-07-29 21:20:06 +02:00
J. Nick Koston
a07f4e0986 Ignore harmony hubs ips that are already configured during ssdp discovery ()
We would connect to the hub via discovery and via setup
around the same time.  This put additional load on the hub
which can increase the risk of timeouts.
2020-07-25 11:13:47 +02:00
J. Nick Koston
76be95d7e0 Make devices and activities visible as harmony attributes ()
* Make devices and activities visibile as harmony attributes

* Allow restoring previous activity, add tests

* fix test

* Kill activity_notify with fire

* remove trailing ,
2020-07-07 09:02:22 -05:00
ehendrix23
2fd6431cff Allow harmony activity change on start of switching activity ()
* Allow activity change on start of switch

Allow activity to be updated when a switch to a new activity is initiated instead of when it is completed.

* Updates based on feedback

Some items are not required to be done as YAML is not used anymore.
Cleaned-up some code.

* Fix for change on how to set callbacks

How callbacks are set now one has to set the new_activity and new_activity_starting as well, even just with None.

* Added callback update

Added so that when it is changed in the UI the callbacks will be changed as well.

* Added test cases for notify setting

Added test cases for config flow to test new setting for activity notifications.
2020-06-19 21:50:42 -05:00
Paulus Schoutsen
ec47216388 Use built-in test helpers on 3.8 () 2020-04-30 13:29:50 -07:00
J. Nick Koston
590e714021 Ensure harmony hub is ready before importing ()
If the harmony hub was not ready for connection or
was busy when importing from yaml, the import validation
would fail would not be retried.

To mitigate this scenario we now do the validation in
async_setup_platform which allows us to raise
PlatformNotReady so we can retry later.
2020-04-02 09:46:10 -07:00
J. Nick Koston
0b2a8bf79a Make harmony handle IP address changes ()
If the IP address of the harmony hub changed it would
not be rediscovered.  We now connect to get the
unique id and then update config entries with
the correct ip if it is already setup.
2020-03-22 21:24:49 -07:00
J. Nick Koston
c9592c1447 Harmony config flow improvements ()
* Harmony config flow improvements

* Address followup review comments from 

* pylint -- catching my naming error

* remove leftovers from refactor
2020-03-19 20:43:44 -05:00
J. Nick Koston
d33a3ca90f Config flow for harmony ()
* Config flow for harmony

* Fixes unique ids when using XMPP

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Find the unique id for the config flow

* move shutdown to init

* Add test for ssdp (still failing)

* Fix ssdp test

* Add harmony to MIGRATED_SERVICE_HANDLERS (this is a breaking change)

* more cleanups

* use unique id for the config file

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-03-19 11:29:51 -05:00