Commit Graph

128 Commits (9a5f88f55f26a9df57371bf9e5416897acb53e45)

Author SHA1 Message Date
Erik Montnemery 49a27e12ad
Add support to entity registry for overriding device_class (#59985) 2021-11-22 08:38:06 -08:00
Paulus Schoutsen 31153ac155
Move fixtures part 1 (#58902) 2021-11-01 20:47:05 -07:00
Erik Montnemery 72d7817dbf
Update light turn_on schema to coerce colors to tuple before asserting sequence type (#58670)
* Make color_name_to_rgb return a tuple

* Tweak

* Tweak

* Update test

* Tweak test
2021-10-29 15:51:14 +02:00
J. Nick Koston def7c80e71
Add support for fan groups (#57941)
* Add support for fan groups

* dry

* dry

* fix refactor error

* tweaks

* wip

* tweaks

* tweaks

* fix

* fixes

* coverage

* tweaks
2021-10-26 10:32:49 +02:00
Erik Montnemery 7e34860615
Improve state of cover groups (#57313)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-10-08 09:52:58 -07:00
Regev Brody 115bb39c10
Fix cover group to handle unknown state properly (#56739)
* fix cover group unknown state

* fix cover grup state

* fix cover group issue
2021-09-29 08:37:16 +02:00
Brian Egge e638e5bb42
Add component for binary sensor groups (#55365)
* Add component for binary sensor groups
https://github.com/home-assistant/home-assistant.io/pull/19239

* Accidental push over prior commit

* Add test for any case

* Add unavailable attribute and tests for unique_id

* Added tests for attributes

link to documentation: https://github.com/home-assistant/home-assistant.io/pull/19297
2021-09-13 15:28:37 +02:00
J. Nick Koston e6e8d7eded
Convert color temperature to visible color in lights (#55219) 2021-08-25 21:56:36 +02:00
Erik Montnemery 20d8c4da90
Report average of position and tilt_position for cover groups (#52713) 2021-08-25 16:12:29 +02:00
Erik Montnemery ee3e27c82a
Add support for white to light groups (#55082) 2021-08-23 18:29:44 +02:00
Franck Nijhof b4a50f5459
Add unique ID support to light, cover and media player groups (#53225) 2021-07-20 13:56:23 +02:00
definitio 132ee972bd
Add media_player.group (#38855)
* Add media group

* Minor improvements

* Use the async api for all methods

* Improve type hints

* Add missing methods

* Add tests

* Rename HomeAssistantType —> HomeAssistant

* Add more tests

* Fix unknown state

* Make some callbacks

* Add more tests

* Fix unknown state properly

* Fix names for callbacks

* Fix stop service test

* Improve tests
2021-06-02 21:25:15 +02:00
Erik Montnemery d2804433d3
Select onoff and brightness color modes last for light groups (#51054) 2021-05-25 08:49:24 -07:00
Joakim Sørensen 2f10f59717
Block custom integrations with missing or invalid version (#49916) 2021-05-17 15:48:41 +02:00
Franck Nijhof 7221b1e09d
Sort effect lists in light groups (#50620) 2021-05-14 21:43:43 -07:00
Erik Montnemery c2663d61d7
Add color_mode support to group light (#50165)
* Add color_mode support to group light

* Lint

* Update tests
2021-05-06 22:34:51 -07:00
Franck Nijhof 5a2b5fe7c5
Yoda assertion style removed is (#48142) 2021-03-20 13:55:10 +01:00
Franck Nijhof 8a56dbf587
Add flake8 comprehensions checks to pre-commit & CI (#48111) 2021-03-19 13:41:09 +01:00
Ville Skyttä dc880118a4
Lint suppression cleanups (#47248)
* Unused pylint suppression cleanups

* Remove outdated pylint bug references

* Add flake8-noqa config and note to run it every now and then

* Add codes to noqa's

* Unused noqa cleanups
2021-03-02 09:02:04 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
J. Nick Koston 8b63e22c99
Bypass the slow update warning for group updates (#43209) 2020-11-14 21:46:24 +01:00
Paulus Schoutsen 5dac3883b0
Stub light profiles (#42232) 2020-10-23 16:28:21 +02:00
Tim Werner 3f623ad453
Rewrite group unittest to pytest style (#42159) 2020-10-23 12:05:07 +02:00
Franck Nijhof 64d3cdfb41
Add nested light group test (#41764) 2020-10-13 08:37:16 -05:00
J. Nick Koston e03b3e2310
Restore group support to plant entities (#41519) 2020-10-09 08:37:27 +02:00
J. Nick Koston 896f64d02b
Fix group tests when run in parallel (#41446) 2020-10-08 00:01:33 -05:00
J. Nick Koston f50976a0b3
Switch to asyncio.wait for slow update warning implementation (#41184) 2020-10-05 15:28:15 +02:00
J. Nick Koston 78dfaa72a2
Ensure lights added after group is created have the correct state (#41034) 2020-10-03 21:29:41 +02:00
J. Nick Koston 42ad36e9f8
Switch group to use None for the state unknown case (#40792) 2020-09-30 17:25:50 +02:00
J. Nick Koston 9ccebdb8d5
Refactor group to extend domains that can be grouped (#40607)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-09-30 09:13:53 -05:00
J. Nick Koston 3880ac0b0d
Ensure group state is recalculated when re-adding on reload (#40497) 2020-09-23 20:55:32 +02:00
J. Nick Koston a778690b64
Support reloading the group notify platform (#39511) 2020-09-03 00:12:07 +02:00
Paulus Schoutsen 6de02fc1b9
Fix some more usages of asynctest (#39570) 2020-09-02 14:53:07 +02:00
J. Nick Koston 3e9963a216
Overcome group concurrent setup limitation (#39483)
With a lot of groups the limitation that groups
had to be setup one at a time could account for
the bulk of startup time.
2020-09-02 10:14:16 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
J. Nick Koston 810df38f0d
Add the ability to reload light/cover groups from yaml (#39250)
* Add the ability to reload light/cover groups from yaml

Update previous usage to reduce code duplication.

* Fix conflict from rebase
2020-08-25 18:13:43 -05:00
J. Nick Koston 63ebea1706
Ensure the context is passed to group changes (#39221) 2020-08-26 00:22:10 +02:00
Matthew Garrett 34e2a1825b
Add support for exposing light effects via Google Assistant (#38575)
* Don't set SUPPORT_EFFECT on DemoLight if there are no effects

This requires an update to the group test - previously the other lights
instantiated by the DemoLight component had nothing in ATTR_EFFECT_LIST, but
still had SUPPORT_EFFECT set. This appears to have resulted in the light
group test code setting an effect on the group and expecting it to apply to
all lights, but given that two of the bulbs didn't actually support any
effects (due to the empty ATTR_EFFECT_LIST) this seems like a broken
assumption and updating the test to verify only the bulb that supports
effects has had one applied seems reasonable.

* Add support for exposing light effects via Google Assistant

The LightEffects trait only supports a fixed (and small) list of lighting
effects, but we can expose them via the Modes trait - this requires saying
"Set (foo) effect to (bar)" which is a little clumsy, but at least makes it
possible.
2020-08-08 14:28:04 -07:00
J. Nick Koston 4a5a09a0e9
Speed up group setup (#38048) 2020-07-21 17:29:57 -07:00
J. Nick Koston 4acc6f333e
Improve scalability of state change event routing (#37174) 2020-06-27 14:46:45 -07:00
Franck Nijhof f42eb0d5ca
Fix missing service call context in multiple locations (#37094) 2020-06-25 17:09:52 -07:00
Paulus Schoutsen c33edbe5bb
Use TestCase.addCleanup (#36560) 2020-06-08 12:26:40 -07:00
Thomas Lovén bdc098645b
Add entity list to light and cover group attributes (#36477)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-05 21:23:52 -07:00
Andre Lengwenus 2b5bb8dac0
Cover group considers opening and closing states (#36203) 2020-06-03 18:44:04 +02:00
Paulus Schoutsen 276f3afb00
Do async_setup_platform in background (#36244)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-31 22:18:30 -07: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
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
Franck Nijhof bc5a2da7b7
Add transition support to scenes, cleanup blocking parameter (#34434) 2020-04-20 18:07:50 -07:00
Franck Nijhof 6d24a65313
Various light test improvements (#34131) 2020-04-13 15:33:04 +02:00
springstan eae21be5b9
Improve string formatting v6 (#33698) 2020-04-07 23:14:28 +02:00
Franck Nijhof 03dd92d51b
Use set literals in tests (#33669) 2020-04-05 02:20:09 +02:00
Bram Kragten 4c4e5f3fa9
Fix demos (#32086)
* Fixes for demos

* Update vacuum.py

* Comment

* Fix tests
2020-03-11 08:16:22 -07:00
springstan ad102b3840
Use f-strings in integrations starting with "F"and"G" (#32150)
* Use f-strings in integrations starting with F

* Use f-strings in tests for integrations starting with F

* Use f-strings in integrations starting with G

* Use f-strings in tests for integrations starting with G

* Fix pylint error

* Fix broken test
2020-02-24 17:54:20 -08:00
Franck Nijhof 2ad1f7fd02
Remove states UI options in group integration (#32021) 2020-02-20 08:26:41 -08:00
Paulus Schoutsen 5fdc60e067
Add Safe Mode (#30723)
* Store last working HTTP settings

* Add safe mode

* Fix tests

* Add cloud to safe mode

* Update logging text

* Fix camera tests leaving files behind

* Make emulated_hue tests not leave files behind

* Make logbook tests not leave files behind

* Make tts tests not leave files behind

* Make image_processing tests not leave files behind

* Make manual_mqtt tests not leave files behind
2020-01-14 13:03:02 -08:00
Franck Nijhof 1e3822bdd7 Migrate group tests from coroutine to async/await (#30389) 2020-01-02 14:22:49 -06:00
Bas Nijholt d0c7db548f use isort to sort imports according to PEP8 for group (#29713) 2019-12-09 09:39:26 +01:00
springstan ed5cdb528c Move imports to top for group (#29485)
* Move imports to top for group

* Fix failing test for group
2019-12-05 13:44:11 +01:00
Pascal Vizeli c1851a2d94
Cleanup coroutine threadsafe (#27080)
* Cleanup coroutine threadsafe

* fix lint

* Fix typing

* Fix tests

* Fix black
2019-10-01 16:59:06 +02:00
Bryan York f45f8f2f3d Emulate color temperature for non-ct lights in light groups (#23495)
* Emulate color temperature for non-ct lights in light groups

* fix tests

* Address review comments

* Fix black formatting

* Fix for pylint

* Address comments

* Fix black formatting

* Address comments
2019-09-15 20:53:05 +02:00
Paulus Schoutsen cf90e49b50
Make reproduce state use platform instead of rely on function (#25856)
* Make reproduce state use platform instead of rely on function

* Fix types

* address comment Martin.
2019-08-11 20:03:21 -07:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
kbickar 7564d1fb52 Added toggle service to covers (#23198)
* Added toggle service to cover

* Added toggle tilt service and tilt closed property

* Added is_tilt_closed so tilt can be toggled

* Added toggle services

* Added toggle tilt service

* Removed spaces

* Added tests for tilt services

* Updated tests

* Added range conversion in comparison

* Added tests to cover broken areas

* Fixed open/close tilt values and added toggle function

* Added default toggle behavior using tilt_position of 0, reverted other changes

* blank space

* Added constants and swapped assert comparisons

* Fixed attribute name

* Added mqtt responses in test

* Added constants

* Space

* Fix tilt_optimistic flag being ignored if status topic set

* Added more tests

* Changed async toggle call

* Updated group tilt test

* Updated format of asserts

* Updated states calls

* Updated function variables

* merge fixes

* Added blank line

* Changed calls to async

* More async updates
2019-06-17 14:09:31 -07:00
Erik Montnemery 5376e15286 Convert some test helpers to coroutines and adjust tests (#23352)
* Convert some test helpers to coroutines

* Fix tests
2019-04-25 10:14:16 +02:00
Jason Hu c82d2cb11c
Cherry pick test fix (#22939) 2019-04-09 13:59:15 -07:00
Robbie Trencheny 7741ec4d5a Great migration notify (#22406)
* Move notify platforms into components

* Move notify tests

* Fix notify tests

* More fixes

* Update requirements

* Update .coveragerc

* Run gen reqs
2019-03-27 20:36:13 -07:00
Paulus Schoutsen 1ddc249989
Consolidate more platforms (#22308)
* Consolidate final platforms

* Fix some tests

* Fix more tests

* Fix more tests
2019-03-23 20:22:35 -07:00
Joakim Plate 3bb5caabe2 Reproduce states by letting each component opt in on handling state recovery itself (#18700)
* Move group to it's own setup

* Let each component to handle restore of state

* Move constants for climate into const.py

For now import all into __init__.py to keep backword compat

* Move media plyaer constants to const.py file

For now import all constants into __init__.py to keep
backword compatibility

* Move media player to it's own file

* Move climate to it's own file

* Remove ecobee service from common components

BREAKING CHANGE

* Add tests for climate

* Add test for media_player

* Make sure we clone timestamps of state

* Add tests for groups

* Remove old tests for media player, it's handled by other tests

* Add tests for calls to component functions

* Add docstring for climate const

* Add docstring for media_player const

* Explicitly import constants in climate

* Explicitly import constants in media_player

* Add period to climate const

* Add period to media_player const

* Fix some lint errors in climate

* Fix some lint errors in media_player

* Fix lint warnings on climate tests

* Fix lint warnings on group tests

* Fix lint warnings on media_player tests

* Fix lint warnings on state tests

* Adjust indent for state tests
2019-02-05 17:25:27 -08:00
Paulus Schoutsen 08fe7c3ece
Pytest tests (#17750)
* Convert core tests

* Convert component tests to use pytest assert

* Lint 🤷‍♂️

* Fix test

* Fix 3 typos in docs
2018-10-24 12:10:05 +02:00
Daniel Perna 9d56730b8d Add optional "all" parameter for groups (#17179)
* Added optional mode parameter

* Cleanup

* Using boolean configuration

* Fix invalid syntax

* Added tests for all-parameter

* Grammar

* Lint

* Docstrings

* Better description
2018-10-09 10:14:55 +02:00
cdce8p f879ac0993 Remove service helper (6) (#16920)
* Update automation

* Update group

* Async_create_task
2018-09-27 23:14:09 +02:00
cdce8p e2a56721d3 Remove service helper (3) (#16879)
* Update duckdns

* Update google_assistant

* Update group

* Update homematic

* Update image_processing

* Update input_boolean

* Update input_number

* Update input_select

* Update input_text
2018-09-26 08:50:05 +02:00
Ville Skyttä dbd0763f83 Grammar and spelling fixes (#16065) 2018-08-19 22:29:08 +02:00
Andrey 140a874917 Add typing to homeassistant/*.py and homeassistant/util/ (#15569)
* Add typing to homeassistant/*.py and homeassistant/util/

* Fix wrong merge

* Restore iterable in OrderedSet

* Fix tests
2018-07-23 10:24:39 +02:00
Anders Melchiorsen dd67192057 Keep auto groups during group reload (#12841)
* Keep auto groups during group reload

* Make protected member public

* Add test
2018-03-02 11:29:49 -08:00
Paulus Schoutsen 183e0543b4
Clean up entity component (#11691)
* Clean up entity component

* Lint

* List -> Tuple

* Add Entity.async_remove back

* Unflake setting up group test
2018-01-22 22:54:41 -08:00
randellhodges 60ce2b343d Tracking all groups to allow changing of existing groups (#11444)
* Tracking all groups to allow changing of existing groups

* Unit tests

* Fix flake8 warnings in test
2018-01-10 14:13:22 -08:00
Paulus Schoutsen f7609e9cb1 Move group services into their own YAML (#9597)
* Move group services into their own YAML

* Fix lint

* Move persistent notification to package
2017-10-01 23:18:10 -07:00