Commit Graph

205 Commits (238b48864292cd2b6d58acfe263f143e786d6598)

Author SHA1 Message Date
Brian Egge 889aced3b6
Fix None support_color_modes TypeError (#55497)
* Fix None support_color_modes TypeError 

https://github.com/home-assistant/core/issues/55451

* Update __init__.py
2021-09-01 08:26:09 +02:00
J. Nick Koston e6e8d7eded
Convert color temperature to visible color in lights (#55219) 2021-08-25 21:56:36 +02:00
Marc Mueller 69e413ac1e
Update pylint to 2.10.1 (#54963)
* Update pylint to 2.10.0

* useless-suppression

* Consider-using-tuple

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Use dict.items()

* Add pylint disable

* Use pylint 2.10.1

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-08-21 10:41:23 +02:00
Marc Mueller 10bfc78365
Fix missing encoding with open() (#53593)
* Fix missing encoding with open()

* Fix tests

* Improve open - frontend
2021-07-28 09:41:45 +02:00
Franck Nijhof 0b44265232
Add description classes to entity components (#53521)
* Add description classes to entity components

* An -> A

* Add StateVacuumEntityDescription
2021-07-27 00:22:21 +02:00
Franck Nijhof c65d120633
Fix typo in min/max mired(s) entity class attribute (#51921) 2021-06-16 09:58:21 +02:00
Erik Montnemery 87813ea991
Tweak light.valid_supported_color_modes (#51659) 2021-06-09 12:53:08 +02:00
Erik Montnemery 443463e19d
Emulate color_temp for lights which support color or white (#51654)
* Emulate color_temp for lights which support color or white

* Support legacy lights

* Tidy up group.light code

* Improve color_temp to white conversion

* Remove color_temp to white conversion

* Add test

* Tweak deconz test
2021-06-09 11:23:01 +02:00
Erik Montnemery e560e623e9
Add color_mode white (#51411)
* Add color_mode white

* Include brightness in white parameter

* Reformat

* Improve test coverage
2021-06-06 11:13:18 +02:00
Erik Montnemery 532626b738
Move light helper get_supported_color_modes (#51269) 2021-05-31 09:47:58 +02:00
Erik Montnemery 154c849eac
Filter unsupported parameters from light service calls (#51084)
* Filter unsupported parameters from light service calls

* Silence pylint

* Fix deconz tests

* Fix mqtt tests

* Fix scene tests

* Fix trådfri emulated CT

* Fix mqtt tests
2021-05-26 08:02:59 +02:00
Franck Nijhof f4289b3fca
Improve supported_color_modes typing in Light (#50969) 2021-05-22 18:48:58 +01:00
Franck Nijhof cad4ec867b
Define light entity attributes as class variables (#50941) 2021-05-22 09:21:31 -07:00
Maciej Bieniek e06a2a53c4
Add constructor return type in integrations L-N (#50888)
* Add constructor return type in integrations L-N

* Small fix
2021-05-20 13:06:44 +01:00
Erik Montnemery 960ed13f94
Update light device actions to check supported_color_modes (#50611) 2021-05-14 22:58:37 +02:00
Erik Montnemery 80b05c39cc
Fix light turn_on color conversion (#50251) 2021-05-07 17:08:46 +02:00
karliemeads 2dedf3dd07
Apply default light profile only when light is toggled from off to on (#49376)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-29 22:06:09 +02:00
Erik Montnemery e96cbccc92
Improve color conversion for RGBWW lights (#49807) 2021-04-28 15:46:41 +02:00
Franck Nijhof 7d7b942dfa
Small typing tweaks to Light component (#49718)
* Small typing tweaks to Light component

* Use abc collection
2021-04-28 12:04:59 +02:00
Erik Montnemery d7247c2ace
Correct conversion of RGB and XY colors to RGBW (#49802) 2021-04-28 10:12:20 +02:00
Erik Montnemery fdadacd158
Improve color conversion for RGBW lights (#49764) 2021-04-27 20:07:55 +02:00
J. Nick Koston 3fa8ffa731
Enable mccabe complexity checks in flake8 (#49616)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-25 12:38:40 +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 b3c9d854f5
Correct min and max mired for light with color_mode support (#49572) 2021-04-22 16:47:33 -07:00
Erik Montnemery 3d90d6073e
Add common light helpers to test for feature support (#49199) 2021-04-15 20:32:27 +02:00
Erik Montnemery ec56ae2cbc
Set deprecated supported_features for MQTT JSON light (#49167)
* Set deprecated supported_features for MQTT json light

* Update homeassistant/components/light/__init__.py

Co-authored-by: Franck Nijhof <git@frenck.dev>

Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-15 17:24:21 +02:00
Erik Montnemery 5e8559e3cc
Validate supported_color_modes for MQTT JSON light (#48836) 2021-04-08 12:40:48 -07:00
Franck Nijhof c1d5638739
Remove HomeAssistantType alias from entity components - Part 2 (#48468) 2021-03-29 13:24:56 -10:00
Erik Montnemery 346a724ac3
Mark base components' state_attribute @final, rename others to extra_state_attributes (#48161)
* Mark base state_attributes @final, rename others to extra_state_attributes

* Fix calendar, update tests
2021-03-21 10:38:24 +01:00
Franck Nijhof 8a56dbf587
Add flake8 comprehensions checks to pre-commit & CI (#48111) 2021-03-19 13:41:09 +01:00
Marc Mueller 25a13d1554
Update typing 10 (#48071) 2021-03-18 13:07:04 +01: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
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
Shay Levy 215ab5fd40
Add type hints to LightEntity (#47024) 2021-03-08 21:21:45 +01:00
Franck Nijhof dd8d4471ec
Postponed evaluation of annotations for integrations (#46455) 2021-02-12 18:54:00 +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
Paulus Schoutsen 5dac3883b0
Stub light profiles (#42232) 2020-10-23 16:28:21 +02:00
Matthias Alphart 93a9a11065
Add config validator helper positive_float (#41640) 2020-10-11 22:04:49 +02:00
J. Nick Koston a8a2109cef
Convert last remaining async_add_job in light to async_add_executor_job (#41518) 2020-10-09 09:32:55 +02:00
Ville Skyttä 1bf2c4d976
Upgrade pylint to 2.6.0 (#39363) 2020-08-29 07:59:24 +02: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
Xiaonan Shen 5d8e6d5432
Fix light toggle service attributes (#35483) 2020-05-11 12:58:59 +02: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
Franck Nijhof 6d24a65313
Various light test improvements (#34131) 2020-04-13 15:33:04 +02:00