Commit Graph

249 Commits (3fda66d9e2cc9dc1347be178b0f5747d7b62a32c)

Author SHA1 Message Date
Erik Montnemery fdadacd158
Improve color conversion for RGBW lights (#49764) 2021-04-27 20:07:55 +02:00
Erik Montnemery a5a3c98aff
Make lights supporting rgbw and rgbww accept colors (#49565)
* Allow lights supporting rgbw and rgbww accepting colors

* Tweak, update tests
2021-04-23 09:25:37 +02:00
Erik Montnemery 7e4be921a8
Add helper to get an entity's supported features (#48825)
* Add helper to check entity's supported features

* Move get_supported_features to helpers/entity.py, add tests

* Fix error handling and improve tests
2021-04-10 08:19:16 +02:00
Erik Montnemery c7584a1f92
Add color_mode support to MQTT JSON light (#47993) 2021-03-31 11:28:45 +02:00
Erik Montnemery 5f2326fb57
Add support for light color modes (#47720)
* Add support for light color modes

* Update tests

* Update comments

* Fix bugs, add tests

* Suppress lint errors

* Don't suppress brightness when state is ambiguous

* Improve reproduce_state + add tests

* Add comment

* Change COLOR_MODE_* constants, rename COLOR_MODE_DIMMER to COLOR_MODE_BRIGHTNESS

* Fix tests

* Tweaks
2021-03-16 12:51:39 +01:00
Drzony 99d1e3e71d
MQTT Light: Use flash attribute in async_turn_off (#47919) 2021-03-15 11:24:07 +01:00
Erik Montnemery b9c2f80cab
Fix light brightness_step on multiple entities (#47746)
* Fix light brightness_step on multiple entities

* Fix comment

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-11 11:46:32 +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
Paulus Schoutsen 352d0870e3
Light significant changes + sensor tweaks (#45583) 2021-01-26 22:11:06 +01:00
Alexei Chetroi daf24dc508
Always apply default light profiles, unless a profile is given (#45450) 2021-01-23 06:20:53 +01:00
Alexei Chetroi ec038bc6ea
Allow any parameter of a light profile as an optional parameter (#44079)
* No code duplication for profile application

* Refactor color profile as a dataclass

* Typing

* Make color_x and color_y of a Light profile optional

* Update tests

* Make brightness field of a Light profile optional

* Transition can be of a float type

* Allow fractional transition times in light profiles

Make transition of a float type.
Allow transition to be optional with 5 column CSV files.

* Make pylint happy

* Fix dropped async_mock

* Simplify CSV row schema
2021-01-13 12:11:20 +01:00
Erik Montnemery 2d9eb25142
Fix parameters when toggling light (#44950) 2021-01-09 01:10:47 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Paulus Schoutsen b3be708db6
Add default config if not there (#43321)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-11-25 15:10:04 +01:00
Paulus Schoutsen 5dac3883b0
Stub light profiles (#42232) 2020-10-23 16:28:21 +02:00
Franck Nijhof c011f3fa95
Use direct service calls in light platform tests (#40604) 2020-09-26 13:19:59 +02:00
Franck Nijhof e30acfbfee
Rewrite light component tests to async pytest tests (#40589) 2020-09-25 19:14:25 +02:00
J. Nick Koston 4bbc737954
Fix light device trigger test flapping (#39470) 2020-08-30 14:34:16 -05:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Donnie 6e87c2ad3e
Support default transition in light profiles (#36747)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-07-21 17:19:07 -07:00
Paulus Schoutsen c33edbe5bb
Use TestCase.addCleanup (#36560) 2020-06-08 12:26:40 -07: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
Xiaonan Shen 5d8e6d5432
Fix light toggle service attributes (#35483) 2020-05-11 12:58:59 +02: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
Erik Montnemery e4333a7a44
Rename Light to LightEntity (#34593) 2020-04-26 18:49:41 +02:00
Franck Nijhof bc5a2da7b7
Add transition support to scenes, cleanup blocking parameter (#34434) 2020-04-20 18:07:50 -07:00
J. Nick Koston e0a7ea52fd
Reduce loss of precision when setting light percent brightness (#34208)
* Reduce loss of precision when setting light percent brightness

This part of an effort to fix all the round trip light
brightness percentages that cause errors with homekit
, alexa, and other devices that use percentage.

* fix demo light test
2020-04-14 13:26:18 -05:00
Robert Chmielowiec 7bd6f5413d
Add flash light device actions (#33689)
* Add flash light device actions

* Single action with extra fields

* Change extra_fields to dictionary
2020-04-13 10:30:20 -07:00
Martin Hjelmare 1d2713b0ea
Clarify light reproduce state deprecation warning (#33531) 2020-04-02 09:52:46 -07:00
Franck Nijhof 743166d284
Fix brightness_pct in light device turn_on action (#32787) 2020-03-13 21:58:32 -07:00
Erik Montnemery c4ac3155e4
Add brightness to light device turn_on action (#32219)
* Add support for setting brightness

* Remove default brightness
2020-02-29 13:33:20 +01:00
Paulus Schoutsen 5092971452
Add brightness light device actions (#31567) 2020-02-09 19:47:59 -08:00
Paulus Schoutsen c85a7934ed
Add brightness_step to light.turn_on (#31452)
* Clean up light turn on service

* Add brightness_step to turn_on schema

* Fix import

* Fix imports 2

* Fix RFLink test
2020-02-04 16:13:29 -08:00
Christian Clauss 1d537ad416 Fix typo: serivce --> service (#31217) 2020-01-27 19:56:26 +01:00
Paulus Schoutsen 9aa02e35a7
Entity Component to no longer generate automatic groups (#23789) 2020-01-07 17:30:53 +01:00
Ville Skyttä fa4fa30461 Various string cleanups (#30435)
* Remove some unnecessary string concatenations

* Replace some simple str.formats with f-strings

* Replace some string concatenations with f-strings
2020-01-03 14:47:06 +01:00
Bas Nijholt aeff27680b use isort to sort imports according to PEP8 for light (#29648) 2019-12-08 22:46:23 +05:30
Paulus Schoutsen dad11f8208 Fix tests & lint 2019-12-04 22:47:40 -08:00
Paulus Schoutsen 02d9ed5e36
Do not select all entities when omitting entity ID in service call (#29178)
* Do not select all entities when omitting entity ID

* Address comments Matthew

* Require either area_id or entity_id

* Fix tests

* Fix test
2019-12-02 16:23:12 -08:00
Paulus Schoutsen d1aa0cea97
Move intent registration to own integration (#29280)
* Move intent registration to own integration.

* Lint
2019-12-01 14:12:57 -08:00
Santobert 7b86f0f926 Add deprecated attributes to light.reproduce_state (#28557)
* Add deprecated attributes to light.reproduce_state

* Add blank line

* fix minor bug

* Typo
2019-11-05 06:43:50 -08:00
Santobert 46ac98379e Add improved scene support to the light integration (#27182)
* light reproduce state

* Add types

* Fix linting error

* Add tests

* Improve test

* Fix failing tests

* Another try

* avoid repetition

* simplified if

* Remove attributes that are no attributes
2019-10-05 12:43:12 -07:00
Erik Montnemery cda7692f24 Add support for `for` to binary_sensor, light and switch device conditions (#27153)
* Add support for `for` to binary_sensor, light and switch device conditions

* Fix typing

* Fixup

* Fixup
2019-10-03 13:29:57 -07:00
Erik Montnemery 65ce3b49c1
Add support for `for` to binary_sensor, light and switch device triggers (#26658)
* Add support for `for` to binary_sensor, light and switch device triggers

* Add WS API device_automation/trigger/capabilities
2019-10-02 22:14:52 +02:00
Paulus Schoutsen 6fdff9ffab
Reorg device automation (#26880)
* async_trigger -> async_attach_trigger

* Reorg device automations

* Update docstrings

* Fix types

* Fix extending schemas
2019-09-24 14:57:05 -07:00
Erik Montnemery 504b8c7685
Fix translation, adjust trigger names (#26635) 2019-09-17 21:55:01 +02:00
Erik Montnemery 6a60ebdb30
Rename MockToggleDevice to MockToggleEntity (#26644)
* Rename MockToggleDevice to MockToggleEntity

* Fix tests
2019-09-15 09:50:17 +02:00
Erik Montnemery 02ded7a4a8 Remove device from device action schema (#26536) 2019-09-09 10:40:22 -07:00
Erik Montnemery b14b14c3c9
Add device automation support to switch entities (#26466)
* Add device automation support to switch entities

* Update switch translations

* Address review comments
2019-09-09 16:55:47 +02:00
Erik Montnemery b1c2a5fa08 Add device automation action (#26455)
* Add support for device actions, with light as example.

* Add translation; return list
2019-09-05 16:26:22 -07:00