🏡 Open source home automation that puts local control and privacy first.
Find a file
BNolet 6fbdcac323
Fix setting color + brightness of Tuya lights (#88470)
* Check if changing TO a color mode

Changing brightness alone does not change work mode, but changing brightness with a color value will keep the light in white mode. 

By verifying the new state has color or not, rather than the existing state being in color work mode, the light will change to color correctly.

Tuya interprets HSV as including the brightness in the (v) value (which is generally what that's used for when setting HSV values). The brightness value given by Home Assistant is still used in this case.

* Fix brightness-only turning colour mode to white

This will take into account the case where brightness is the only parameter for both the case of colour mode and white mode.

Tests passed after this change:

* Brightness only (colour mode) 
* Brightness only (white mode) 
* Colour only (colour mode) 
* Colour only (white mode) 
* Colour temp only (colour mode) 
* Colour temp only (white mode) 
* Colour + brightness (colour mode) 
* Colour + brightness (white mode) 
* Colour temp + brightness (colour mode) 
* Colour temp + brightness (white mode) 

* Fix code formatting
2023-03-28 12:20:54 +02:00
.devcontainer Drop flake8 in favor of Ruff (#89863) 2023-03-17 13:30:06 +01:00
.github Fail CI if codecov upload fails (#90363) 2023-03-27 20:49:49 +02:00
.vscode Drop flake8 in favor of Ruff (#89863) 2023-03-17 13:30:06 +01:00
docs Enable Ruff D212 (#87347) 2023-02-03 23:08:48 +01:00
homeassistant Fix setting color + brightness of Tuya lights (#88470) 2023-03-28 12:20:54 +02:00
machine Add Hardkernel ODROID-M1 (#89431) 2023-03-09 14:18:19 +01:00
pylint/plugins Add RestoreEntity pylint checks to all platforms (#90020) 2023-03-27 20:08:20 +02:00
rootfs Fix logging & exit code reporting to S6 on HA shutdown (#72921) 2022-06-02 19:49:08 +02:00
script Bump cryptography to 40.0.1 (#90326) 2023-03-26 12:30:17 -10:00
tests Fix ridwell tests (#90401) 2023-03-28 11:54:16 +02:00
.core_files.yaml Adjust IntFlag handling in syrupy (#90223) 2023-03-26 14:20:05 +02:00
.coveragerc Add a calendar entity to Ridwell (#88108) 2023-03-28 09:31:36 +02:00
.dockerignore Not to Tox (#76582) 2022-11-23 14:40:37 +01:00
.gitattributes highlight Dockerfile.dev as Dockerfile in github ui (#36933) 2020-06-22 14:45:57 +02:00
.gitignore Remove translations from Core (#87543) 2023-02-06 15:06:43 +01:00
.hadolint.yaml Add hadolint to CI (#34758) 2020-04-27 12:09:31 +02:00
.pre-commit-config.yaml Drop autoflake in favor of Ruff (#89874) 2023-03-17 21:37:41 +01:00
.prettierignore Add Leviton brand (#79244) 2022-09-29 12:28:51 +02:00
.readthedocs.yml Update readthedocs config (#65230) 2022-01-30 20:15:32 -08:00
.strict-typing Strict typing of UniFi integration (#90278) 2023-03-26 09:57:13 +02:00
.yamllint Add filters to climate and light service descriptions (#86162) 2023-03-16 15:59:51 +01:00
build.yaml Bump docker base to 2023.02.0 (#88084) 2023-02-14 20:34:54 -05:00
CLA.md Update LICENSE.md and CLA.md to reflect the new Apache 2.0 license 2017-01-28 12:12:34 -08:00
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md (#73468) 2022-06-23 01:41:22 +02:00
codecov.yml Add recorder platform to required test category (#86704) 2023-01-26 11:03:56 +01:00
CODEOWNERS Implement config flow for nextcloud (#89396) 2023-03-26 21:14:17 +02:00
CONTRIBUTING.md Use core GitHub URL in contributing guidelines (#41083) 2020-10-02 20:42:33 +02:00
Dockerfile 75142 Added QEMU_CPU ARG to the dockerfile (#86178) 2023-01-19 10:22:23 +01:00
Dockerfile.dev Drop flake8 in favor of Ruff (#89863) 2023-03-17 13:30:06 +01:00
LICENSE.md Update license to official GitHub template (#16470) 2018-09-07 10:11:51 +02:00
MANIFEST.in Move remaining keys to setup.cfg (#65154) 2022-01-28 20:18:09 -08:00
mypy.ini Strict typing of UniFi integration (#90278) 2023-03-26 09:57:13 +02:00
pyproject.toml Bump cryptography to 40.0.1 (#90326) 2023-03-26 12:30:17 -10:00
README.rst Change README demo to demo.home-assistant.io subdomain (#89921) 2023-03-19 07:52:42 +01:00
requirements.txt Bump cryptography to 40.0.1 (#90326) 2023-03-26 12:30:17 -10:00
requirements_all.txt Bump pychromecast to 13.0.6 (#90390) 2023-03-28 09:36:34 +02:00
requirements_docs.txt Refactor API documentation (#33217) 2020-03-25 13:21:04 -07:00
requirements_test.txt Update pipdeptree to 2.7.0 (#90312) 2023-03-26 09:47:47 -10:00
requirements_test_all.txt Bump pychromecast to 13.0.6 (#90390) 2023-03-28 09:36:34 +02:00
requirements_test_pre_commit.txt Drop autoflake in favor of Ruff (#89874) 2023-03-17 21:37:41 +01:00
setup.cfg Drop flake8 in favor of Ruff (#89863) 2023-03-17 13:30:06 +01:00

Home Assistant |Chat Status|
=================================================================================

Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.

Check out `home-assistant.io <https://home-assistant.io>`__ for `a
demo <https://demo.home-assistant.io>`__, `installation instructions <https://home-assistant.io/getting-started/>`__,
`tutorials <https://home-assistant.io/getting-started/automation/>`__ and `documentation <https://home-assistant.io/docs/>`__.

|screenshot-states|

Featured integrations
---------------------

|screenshot-integrations|

The system is built using a modular approach so support for other devices or actions can be implemented easily. See also the `section on architecture <https://developers.home-assistant.io/docs/architecture_index/>`__ and the `section on creating your own
components <https://developers.home-assistant.io/docs/creating_component_index/>`__.

If you run into issues while using Home Assistant or during development
of a component, check the `Home Assistant help section <https://home-assistant.io/help/>`__ of our website for further help and information.

.. |Chat Status| image:: https://img.shields.io/discord/330944238910963714.svg
   :target: https://discord.gg/c5DvZ4e
.. |screenshot-states| image:: https://raw.githubusercontent.com/home-assistant/core/master/docs/screenshots.png
   :target: https://demo.home-assistant.io
.. |screenshot-integrations| image:: https://raw.githubusercontent.com/home-assistant/core/dev/docs/screenshot-integrations.png
   :target: https://home-assistant.io/integrations/