Commit Graph

70 Commits (d0b4210de5db623fd916d3dd2f1f090842cc6541)

Author SHA1 Message Date
Sid ccd2e989c3
Enable ruff RUF005 and fix occurrences (#113589) 2024-03-16 07:37:20 -10:00
Marc Mueller 32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc Mueller 87165c0d6e
Add empty line after module docstring [tests t-z] (#112712) 2024-03-08 14:44:56 +01:00
Jan-Philipp Benecke e3b09a5470
Migrate vizio tests to use freezegun (#105417) 2024-01-02 12:53:03 +01:00
J. Nick Koston 0eca433004
Update zeroconf discovery to use IPAddress objects to avoid conversions (#100567) 2023-09-19 18:58:46 +02:00
J. Nick Koston 3a06659120
Speed up single entity/response service calls (#96729)
* Significantly speed up single entity/response service calls

Since the majority of service calls are single entity, we can
avoid creating tasks in this case. Since the multi-entity
service calls always check the result and raise, we can switch
the asyncio.wait to asyncio.gather

* Significantly speed up single entity/response service calls

Since the majority of service calls are single entity, we can
avoid creating tasks in this case. Since the multi-entity
service calls always check the result and raise, we can switch
the asyncio.wait to asyncio.gather

* revert

* cannot be inside pytest.raises

* one more

* Update homeassistant/helpers/service.py
2023-07-17 09:33:13 +02:00
J. Nick Koston b966ff7a3d
Await in sequence when we know we will be blocked by the entity platform semaphore (#93649)
* Defer creating tasks we know are going to wait on the entity platform semaphore

When looking at whats going on with aiomonitor-ng, I noticed
we end up creating a lot of tasks that block waiting for the
executor because of the entity platform parallel_updates semaphore.

When we know the tasks are going to block we now await them
in sequence to avoid feeding the loop a herd of tasks that
will block on the semaphore

* change during iteration fix

* change during iteration fix

* cleanup

* cleanup

* fix vizio test
2023-05-27 19:58:02 -04:00
epenet aa50096a31
Add type hints to integration tests (part 24) (#88307) 2023-02-17 16:34:53 +01:00
Franck Nijhof e4a78420b8
Enable Ruff PT013 (#86757)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-27 09:09:46 +01:00
epenet 0d696b84b2
Cleanup root component imports in tests (#78893) 2022-09-21 06:57:41 -10:00
Franck Nijhof 7cd68381f1
Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
Dave T 865159781f
Use new enums in vizio tests (#62710)
* Use new enums in vizio tests

* Code review: revert wrong conftest changes

* Code review: Revert incorrect removal of vizio const

* Reinstate wrongly reverted files

* Fix double line

* Fix new test after rebase
2022-02-21 08:28:56 +01:00
Raman Gupta 051bf173dc
revert change in vizio logic to fix bug (#66424) 2022-02-14 09:49:19 +02:00
Joshua Roys 9134e5c844
Get discovered zeroconf IPv6 addresses (#65462) 2022-02-11 16:46:17 -06:00
Raman Gupta 867f8237e9
Remove attributes from vizio state when they don't make sense (#64025)
* Remove attributes from vizio state when they don't make sense

* rename var
2022-01-13 20:59:55 +01:00
Robert Hillis 432d48a4d7
Use platform enums in vizio tests (#62555) 2021-12-22 07:33:13 -05:00
epenet cbab0ba9c0
Drop base ATTR constants in zeroconf (#60561)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-01 12:29:41 +01:00
epenet 54df81cbab
Use ZeroconfServiceInfo in vizio (#60115)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-29 18:27:15 +01:00
Paulus Schoutsen b0f24b65d6
Drop more persistent notification patches (#57295) 2021-10-08 16:45:05 +02:00
Raman Gupta f0e0b41f77
Use entity attributes for vizio integration (#56093) 2021-09-27 20:20:15 +02:00
Raman Gupta 92d1871de5
Fix flaky vizio test and add comments to explain logic (#50948) 2021-05-22 08:57:30 +02:00
Raman Gupta 6cb283d36b
Fix vizio integration (#50436) 2021-05-11 22:05:45 -07:00
jan iversen 6992e24263
Rename HomeAssistantType —> HomeAssistant, integrations t* - v* (#49544)
* Integration vizio: HomeAssistantType -> HomeAssistant.

* Integration velbus: HomeAssistantType -> HomeAssistant.

* Integration vacuum: HomeAssistantType -> HomeAssistant.

* Integration upnp: HomeAssistantType -> HomeAssistant.

* Integration upcloud: HomeAssistantType -> HomeAssistant.

* Integration twinkly: HomeAssistantType -> HomeAssistant.

* Integration tts: HomeAssistantType -> HomeAssistant.

* Integration tradfri: HomeAssistantType -> HomeAssistant.

* Integration traccar: HomeAssistantType -> HomeAssistant.

* Integration tplink: HomeAssistantType -> HomeAssistant.
2021-04-22 10:53:57 -04:00
Marc Mueller 54d1e9985f
Update typing 15 (#48079) 2021-03-18 15:13:22 +01:00
Raman Gupta 783e0f9a14
Setup config entry even if vizio device is unreachable (#46864) 2021-02-24 20:15:47 +01:00
Paulus Schoutsen 9e07910ab0
Mark entities as unavailable when they are removed but are still registered (#45528)
* Mark entities as unavailable when they are removed but are still registered

* Add sync_entity_lifecycle to collection helper

* Remove debug print

* Lint

* Fix tests

* Fix tests

* Update zha

* Update zone

* Fix tests

* Update hyperion

* Update rfxtrx

* Fix tests

* Pass force_remove=True from integrations

Co-authored-by: Erik <erik@montnemery.com>
2021-02-08 10:45:46 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Raman Gupta b651f63ef0
Suppress vizio logging API call failures to prevent no-op logs (#44388) 2021-01-01 13:35:05 +01:00
Raman Gupta 95504b7408
Abort vizio discovery flow without unique ID (#43303)
* abort vizio discovery flow if unique ID cant be found because it means we cant connect

* add tests

* fix abort call
2020-11-17 07:11:42 +01:00
Raman Gupta 098dead16d
Fix Vizio host string for zeroconf discovery (#42738) 2020-11-02 13:08:36 +01:00
Philip Allgaier dde6305549
Cleanup unused loggers (components N-Z + tests) (#41982) 2020-10-16 21:24:08 -05:00
Raman Gupta d0a5feda44
Fix Vizio async_unload_entry bug (#40210) 2020-09-18 13:18:56 +02:00
Ville Skyttä aad6a24f28
Fix vizio async mock fixtures on Python 3.8.0 and .1 (#39926) 2020-09-14 08:35:30 +02:00
Raman Gupta 04c849b0ee
Remove vizio test assertions for integration details in test_init (#39579) 2020-09-02 18:38:53 +02:00
Martin Hjelmare 24f63127de
Fix vizio black formatting (#39573) 2020-09-02 14:16:23 +02:00
Raman Gupta 7ff633f531
Automatically update app list for Vizio SmartTV's (#38641) 2020-09-02 11:55:10 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Raman Gupta fbf44b37a9
Simplify vizio unique ID check since only IP and device class are needed (#37692) 2020-08-12 16:50:36 +02:00
Raman Gupta 0d5e279509
Standardize Vizio update service schema (#38636)
* update voluptuous schema to match standards and to handle data transformations

* improve test
2020-08-07 21:29:54 -05:00
Raman Gupta 297dd9bbc2
Add vizio service to update a device setting (#36739)
* track all settings and add service to update a setting

* sort setting types

* reduce frequency of updates due to the increase in API calls per update

* change dict call to a get in case audio settings aren't available

unlikely to occur but less error prone

* Update if statement to be more consistent

* revert changes to track all settings and store in state machine

* revert one more change

* force setting_type and setting_name to lowercase to make it easier to understand how to make service call

* make service calls even simpler by attempting to transform certain parameters as much as possible
2020-08-06 22:43:03 -04:00
Raman Gupta 572d5a09cd
Vizio: when checking new host against existing config entry hosts, make check hostname aware (#37397)
* make ip check hostname aware

* add executor job for sync function doing IO and remove errant comma

* revert change to update new_data explicitly for options keys since it is already done later

* empty commit to retrigger CI
2020-07-08 15:31:41 -04:00
Raman Gupta db92ffdf89
Clean up vizio translation strings (#35725)
* further vizio string updates

* fix errant find/replace
2020-05-25 16:36:49 -04:00
Paulus Schoutsen 2af984917e
Use asynctest-mock in most places (#35109)
* Use asynctest-mock in most places

* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
Raman Gupta 3e06e6b4b3
Don't attempt to set Vizio is_volume_muted property if Vizio API doesn't provide muted state (#34782) 2020-04-30 21:05:45 -07:00
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
Raman Gupta c9cc024e9b
Abort vizio zeroconf config flow if unique ID is already configured (#34313) 2020-04-16 16:16:35 -07:00
Raman Gupta ca67fd9faa
Skip ignored hosts when checking existing config entries in config flow (#34280) 2020-04-16 14:53:34 -07:00
Raman Gupta 8825561a99
Refactor vizio media_player tests to remove conditional statements from helper function (#33615) 2020-04-16 14:52:43 -07:00
Raman Gupta b46eee04e4
Fix vizio bug that occurs when CONF_APPS isn't in config entry… (#33857)
* fix bug when search for string in dict fails when dict is null

* another bug fix that I only noticed because of this other bug

* add test to cover failure scenario

* update docstring

* add additional assertions to cover failure scenario that's being fixed
2020-04-08 20:44:33 -07:00
Franck Nijhof 262b01d632
Removal of old style class definitions in tests (#33671) 2020-04-05 02:21:07 +02:00