Commit graph

502 commits

Author SHA1 Message Date
Hosted Weblate
2ab247243d Translated using Weblate (French)
Currently translated at 67.9% (104 of 153 strings)

Translated using Weblate (French)

Currently translated at 67.9% (104 of 153 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Loïc R <loicdu81@gmail.com>
Co-authored-by: Maxime Bailleul <mexx.bailleul@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/fr/
Translation: Adaptive Lighting/Adaptive Lighting
2023-08-19 10:40:05 -07:00
Hosted Weblate
e86744c6a3 Translated using Weblate (Dutch)
Currently translated at 68.6% (105 of 153 strings)

Co-authored-by: Bas Rutjes <bas@rutjes.online>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/nl/
Translation: Adaptive Lighting/Adaptive Lighting
2023-08-19 10:40:05 -07:00
Hosted Weblate
be440b9641 Translated using Weblate (Polish)
Currently translated at 76.4% (117 of 153 strings)

Translated using Weblate (Polish)

Currently translated at 69.2% (106 of 153 strings)

Translated using Weblate (Polish)

Currently translated at 65.3% (100 of 153 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Łukasz Marek <lukasz.marek1986@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/pl/
Translation: Adaptive Lighting/Adaptive Lighting
2023-08-19 10:40:05 -07:00
Hosted Weblate
c53816224c Translated using Weblate (French)
Currently translated at 54.9% (84 of 153 strings)

Co-authored-by: Maxime Bailleul <mexx.bailleul@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/fr/
Translation: Adaptive Lighting/Adaptive Lighting
2023-08-18 11:22:51 -07:00
Hosted Weblate
65b82b605e Translated using Weblate (Polish)
Currently translated at 64.0% (98 of 153 strings)

Co-authored-by: Łukasz Marek <lukasz.marek1986@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/pl/
Translation: Adaptive Lighting/Adaptive Lighting
2023-08-18 11:22:51 -07:00
Weblate (bot)
857ac10856
Translations update from Hosted Weblate (#761)
* Translated using Weblate (Dutch)

Currently translated at 57.5% (88 of 153 strings)

Translation: Adaptive Lighting/Adaptive Lighting
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/nl/

* Translated using Weblate (Dutch)

Currently translated at 58.1% (89 of 153 strings)

Translation: Adaptive Lighting/Adaptive Lighting
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/nl/

* Translated using Weblate (Dutch)

Currently translated at 62.0% (95 of 153 strings)

Translation: Adaptive Lighting/Adaptive Lighting
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/nl/

---------

Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
2023-08-17 19:45:24 -07:00
Weblate (bot)
239aae8ed7
Translated using Weblate (Dutch) (#760)
* Translated using Weblate (Dutch)

Currently translated at 57.5% (88 of 153 strings)

Translation: Adaptive Lighting/Adaptive Lighting
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/nl/

* Translated using Weblate (Dutch)

Currently translated at 58.1% (89 of 153 strings)

Translation: Adaptive Lighting/Adaptive Lighting
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/nl/

---------

Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
2023-08-17 14:43:44 -07:00
Weblate (bot)
3757a66829
Translated using Weblate (German) (#758)
Currently translated at 55.5% (85 of 153 strings)

Translation: Adaptive Lighting/Adaptive Lighting
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/de/

Co-authored-by: Michel Balzer <hallo@michelbalzer.de>
2023-08-16 21:04:59 -07:00
Bas Nijholt
2211aa07b5
Revert "Translations update from Hosted Weblate (de, nl, fr) (#755)" (#757)
This reverts commit 627c7a120c.
2023-08-15 23:16:17 -07:00
Weblate (bot)
627c7a120c
Translations update from Hosted Weblate (de, nl, fr) (#755)
* Translated using Weblate (German)

Currently translated at 0.0% (0 of 153 strings)

Translation: Adaptive Lighting/Adaptive Lighting
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/de/

* Translated using Weblate (French)

Currently translated at 0.0% (0 of 153 strings)

Translation: Adaptive Lighting/Adaptive Lighting
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/fr/

* Translated using Weblate (Dutch)

Currently translated at 56.8% (87 of 153 strings)

Translation: Adaptive Lighting/Adaptive Lighting
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/nl/

---------

Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
2023-08-15 20:02:47 -07:00
Weblate (bot)
93cfda427a
Translations update from Hosted Weblate (#754)
* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: Adaptive Lighting/Adaptive Lighting
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/

* Translated using Weblate (Dutch)

Currently translated at 24.1% (37 of 153 strings)

Translation: Adaptive Lighting/Adaptive Lighting
Translate-URL: https://hosted.weblate.org/projects/adaptive-lighting/adaptive-lighting/nl/

---------

Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
2023-08-15 19:09:55 -07:00
Bas Nijholt
7e84ed0a84
Use WebLate for translations (#753)
* Add license

* lunk

* chore(docs): update TOC

* fix

---------

Co-authored-by: basnijholt <basnijholt@users.noreply.github.com>
2023-08-15 17:09:18 -07:00
Bas Nijholt
792bed8cf6 Bump to 1.19.1 in manifest.json 2023-08-15 15:25:29 -07:00
pre-commit-ci[bot]
7a7baafcb3
[pre-commit.ci] pre-commit autoupdate (#748)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.282 → v0.0.284](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.282...v0.0.284)

* Ruff fixes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bas Nijholt <bas@nijho.lt>
2023-08-15 15:25:19 -07:00
Bas Nijholt
0e23e906da
Fix #745, first time YAML setup (#752)
* Check whether this is the first time setup

* Keep list

* simplify

* no UI tracking
2023-08-15 14:47:43 -07:00
Bas Nijholt
e9b7988868
Fix skipped path in multi light intercept (#751)
* Fix skipped path in multi light intercept

* Deepcopy to make sure that _service_interceptor_turn_on_single_light_handler doesn't moddify

* fix
2023-08-15 12:52:39 -07:00
Bas Nijholt
68feb3d931
Make instantaneous light.turn_on adaptation configurable with intercept (#750)
* Make intercept configurable

* Update README.md, strings.json, and services.yaml

* import

* skip

* split

* do not pass config_entry

* add to conf

* Update README.md, strings.json, and services.yaml

* spacing

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-15 12:23:56 -07:00
Bas Nijholt
9112bb9f73
Bump to 1.19.0 in manifest.json (#734) 2023-08-09 19:06:48 -07:00
Bas Nijholt
5b7ee44629
Fix length of descriptions in UI (config flow) (#732)
* Fix length of strings in UI

* Update README.md, strings.json, and services.yaml

* fix

* add desc

* Update README.md, strings.json, and services.yaml

* mention webapp

* Add desc

* link

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-10 00:17:25 +00:00
Bas Nijholt
435b2ce5d0
Fix adapt_only_on_bare_turn_on and apply does not result in manual_control (#729)
* Fix adapt_only_on_bare_turn_on and apply does not result in manual_control

Closes #723

* fix style
2023-08-09 21:48:18 +00:00
Bas Nijholt
da5147a583
Bump to 1.19.0b5 in manifest.json (#728) 2023-08-09 13:56:00 -07:00
Bas Nijholt
597e050ab2
Prevent light.turn_on of light that was just turned off (#727)
Closes #726
2023-08-09 13:54:18 -07:00
Bas Nijholt
f8e7880a96
Split up SunLightSettings and improve https://basnijholt.github.io/adaptive-lighting/ (#719)
* Split up SunLightSettings

* Renames

* factor out SunEvents

* more renames

* rewrite

* rewrite more

* simpler

* refactor

* refact

* raise

* refact

* rename

* move method

* clean

* Move to new module 'sun.py'

* make sun independent of HA

* rename

* Move to webapp/homeassistant_util_color.py

* Rework app

* Add link

* new plotting

* app changes

* fix tests

* test clean

* tz fixes

* fix

* use sed

* verbose

* fix tz

* fix

* tiem
2023-08-08 21:31:17 +00:00
Bas Nijholt
00ec76a467
Bump to 1.19.0b4 in manifest.json (#718) 2023-08-06 19:21:39 -07:00
Bas Nijholt
ef1546b6b9
Fix min_sunrise_time and max_sunset_time (#717)
Closes #714
2023-08-07 02:21:16 +00:00
Bas Nijholt
104664d358
Bump to 1.19.0b3 in manifest.json (#713) 2023-08-06 11:21:54 -07:00
Bas Nijholt
cb9ae39ee4
Fix adaptive_lighting.change_switch_settings service (#712)
* Fix adaptive_lighting.change_switch_settings service

Closes #623

* filter defaults

* fix mutable

* Revert debugging logs
2023-08-06 11:15:14 -07:00
Bas Nijholt
d2c6811e63
Bump to 1.19.0b2 in manifest.json (#710) 2023-08-05 23:06:27 -07:00
Benjamin Auquite
fec50ad526
Adapt lights simultaneously instead of one by one (#529)
* Update switch.py

* Update test_switch.py

* Revert "Update test_switch.py"

This reverts commit 87ea5243b9.

* remove unnecessary create_task

* remove unneeded len()

* Revert "remove unnecessary create_task"

This reverts commit 2c5da6d739.

* use `hass.async_create_task`

---------

Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
Co-authored-by: Bas Nijholt <bas@nijho.lt>
2023-08-05 21:19:18 -07:00
Bas Nijholt
d44cb66148
Add adapt_only_on_bare_turn_on which instantly triggers manual_control when turning on with brightness or color (#709) 2023-08-05 20:56:32 -07:00
Bas Nijholt
72419cb60f
Add a min_sunrise_time and max_sunset_time (#707) 2023-08-05 22:08:45 +00:00
Bas Nijholt
11a4489cb5
Bump to 1.19.0b1 manifest.json (#706) 2023-08-05 14:42:40 -07:00
Bas Nijholt
51a18f2afb
Allow adaptive_lighting.apply to turn on lights and do not issue log message (#705) 2023-08-05 20:59:58 +00:00
Bas Nijholt
e3a84ffd96
Logging fixes in significant_changes (#704) 2023-08-05 13:52:54 -07:00
Bas Nijholt
a1cec19351
feat: add different brightness ramping mechanisms (#699)
* feat: add different brightness ramping mechanisms

* Rephrase

* Fix curves

* update images

* link to other graphs

* update images
2023-08-05 20:14:21 +00:00
Bas Nijholt
9a7cff9d6a
feat: change the order of options in config flow (#700)
* Change the order of options in config flow

* Update README.md, strings.json, and services.yaml

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-04 21:45:12 +00:00
Bas Nijholt
1ef7ed507e
Implement call intercept for multiple lights (#679)
* Implement call intercept for multiple lights

* remove comment

* skip if no eids

* add comment

* fix type

* Fix skipped

* indentation

* Add logging and fix error

* Fix for HA ≤2023.04

* simplify

* remove unused ignores

* Debug mode

* Add test

* Make test failing

* rename switch

* rename lights

* Fix tests

* Rename lights in tests

* Remove unused dependencies

* Improve tests

* More tests

* Remove the DEBUG_MODE

* Add doc-string

* Extra test

* assert

* extra test

* Comments

* fix

* fix

* expand light groups

* more logging

* sort

* Revert is_proactively_adapting checks
This reverts commit 39fd8f2be0.

* simplify the mapping

* Revert "Revert is_proactively_adapting checks"

This reverts commit 18803e8e50.

* test

* no light groups

* do not expand

* Do not expand_light_groups in intercept

* more logging

* Fix

* add comment

* Add multi_light_intercept config option

* Update README.md, strings.json, and services.yaml

* add light group

* fix platform

* add simple test

* turn off again

* Test without take over control

* improve test and fix it in one way

* Fixes

* add cleanup fixture

* format

* Update test_switch.py

* add __str__

* remove unneeded call

* simplify service_data construction

* Generalize is_our_context

* Fix multi_light_intercept: false

* add comments

* add docs

* Update README.md, strings.json, and services.yaml

* Add feature line

* move function

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-03 17:47:09 -07:00
Bas Nijholt
4251ccacc5
Bump to 1.18.3 in manifest.json (#698) 2023-08-04 00:46:19 +00:00
Bas Nijholt
b80b253fa1
Warning when calling light.turn_on with brightness=0 (#678)
* Do not update the call when calling light.turn_on with brightness=0

* Simplify

* issue warning instead
2023-08-02 23:12:13 -07:00
Bas Nijholt
e0e04da0f6
Before scheduling turn_on do a last-minute check if lights are off (#671)
* Before scheduling turn_on do a last-minute check if lights are off

* Pass force

* add comment

* fix for proactive

* commetn

* No default for force

* rm newline

* no force

* Return bool
2023-08-02 23:11:45 -07:00
Bas Nijholt
53ed220fa0
Bail adapting if on event equals off event context (#696)
* Bail adapting if on event equals off event context
Should prevent this (I saw in my logs)
```
2023-08-02 21:49:56.516 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'light.turn_off('['light.philips_go', 'light.bed_led', 'light.bamboo']', transition=10.0)' event with context.id='01H6WVP8RJF4JZ78SFD98YA0RG'
2023-08-02 21:49:56.637 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'on' → 'off' event for 'light.bamboo' with context.id='01H6WVP8RJF4JZ78SFD98YA0RG'
2023-08-02 21:49:56.672 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'on' → 'off' event for 'light.bed_led' with context.id='01H6WVP8RJF4JZ78SFD98YA0RG'
2023-08-02 21:49:56.747 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'on' → 'off' event for 'light.philips_go' with context.id='01H6WVP8RJF4JZ78SFD98YA0RG'
2023-08-02 21:50:00.501 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.philips_go' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6666, 'min_mireds': 150, 'max_mireds': 500, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'candle', 'fireplace', 'colorloop', 'finish_effect', 'stop_effect', 'stop_hue_effect'], 'supported_color_modes': ['color_temp', 'xy'], 'color_mode': <ColorMode.XY: 'xy'>, 'brightness': 10, 'hs_color': (0.0, 100.0), 'rgb_color': (255, 0, 0), 'xy_color': (0.701, 0.299), 'friendly_name': 'Philips Go', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H6WVP8RJF4JZ78SFD98YA0RG'
2023-08-02 21:50:00.502 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.philips_go' with context.id='01H6WVP8RJF4JZ78SFD98YA0RG'
2023-08-02 21:50:00.502 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01H6WVP8RJF4JZ78SFD98YA0RG'
2023-08-02 21:50:00.502 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] just_turned_off: Waiting with adjusting 'light.philips_go' for 6.240101
2023-08-02 21:50:00.528 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.bed_led' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6535, 'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'candle', 'fireplace', 'colorloop', 'finish_effect', 'stop_effect', 'stop_hue_effect'], 'supported_color_modes': ['color_temp', 'xy'], 'color_mode': <ColorMode.XY: 'xy'>, 'brightness': 10, 'hs_color': (10.824, 100.0), 'rgb_color': (255, 46, 0), 'xy_color': (0.689, 0.309), 'friendly_name': 'Bed LED', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H6WVP8RJF4JZ78SFD98YA0RG'
2023-08-02 21:50:00.529 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.bed_led' with context.id='01H6WVP8RJF4JZ78SFD98YA0RG'
2023-08-02 21:50:00.529 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01H6WVP8RJF4JZ78SFD98YA0RG'
2023-08-02 21:50:00.529 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] just_turned_off: Waiting with adjusting 'light.bed_led' for 6.129017
2023-08-02 21:50:00.561 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected a 'light.bamboo' 'state_changed' event: '{'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6535, 'min_mireds': 153, 'max_mireds': 500, 'effect_list': ['blink', 'breathe', 'okay', 'channel_change', 'candle', 'fireplace', 'colorloop', 'finish_effect', 'stop_effect', 'stop_hue_effect'], 'supported_color_modes': ['color_temp', 'xy'], 'color_mode': <ColorMode.XY: 'xy'>, 'brightness': 10, 'hs_color': (299.434, 83.137), 'rgb_color': (253, 43, 255), 'xy_color': (0.382, 0.159), 'friendly_name': 'Bamboo', 'supported_features': <LightEntityFeature.EFFECT|FLASH|TRANSITION: 44>}' with context.id='01H6WVP8RJF4JZ78SFD98YA0RG'
2023-08-02 21:50:00.562 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] Detected an 'off' → 'on' event for 'light.bamboo' with context.id='01H6WVP8RJF4JZ78SFD98YA0RG'
2023-08-02 21:50:00.562 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] is_proactively_adapting_context='False', context_id='01H6WVP8RJF4JZ78SFD98YA0RG'
2023-08-02 21:50:00.562 DEBUG (MainThread) [custom_components.adaptive_lighting.switch] just_turned_off: Waiting with adjusting 'light.bamboo' for 6.072956
```

* log instead
2023-08-02 22:59:01 -07:00
Bas Nijholt
807f7109d4
Require take_over_control for to ignore non-turn_on state off -> on event (#695) 2023-08-03 00:59:44 +00:00
Bas Nijholt
e513393653
Keep on and off state tracking in Manager and listen to toggle (#689)
* Keep on and off state tracking in Manager

* Move manual_control code

* add todo

* check is_on

* Track toggle

* handle toggle

* fix debug

* test

* add comment

* better log

* Fix comment

* log

* test

* get

* check

* cancel early

* rephrase

* add assert

* Remove check
2023-07-31 18:40:32 -07:00
Bas Nijholt
aa9f69a7bb
Set last_service_data in the right place (#652)
* Set last_service_data in the right place

* Do not get but access key

* rename
2023-07-31 17:52:53 -07:00
Bas Nijholt
d588a5984a
Refactor _update_attrs_and_maybe_adapt_lights (#688)
* Do not call self.manager.significant_change when not needed

* refact

* fix

* fix

* Add more logging to tests

* remove
2023-07-31 04:57:30 +00:00
Bas Nijholt
1842ac9bd5
Do not assert but issue a warning (#687)
* Do not assert but issue a warning

* bump to 1.18.2
2023-07-30 13:28:58 -07:00
Bas Nijholt
e98f0dfa55 Bump to 1.18.1 2023-07-30 13:11:30 -07:00
Bas Nijholt
f4d872a540
Make sure that SimpleSwitches are added before AdaptiveSwitch (#686) 2023-07-30 20:01:08 +00:00
Bas Nijholt
2e25af3125
Do not intercept effect and flash calls (#685)
* Do not intercept effect and flash calls

* log

* Do not intercept flash
2023-07-30 19:32:59 +00:00
Bas Nijholt
2b35ee1e5e
Mark as manually controlled when using flash, effect, or RGBW(W) (#684)
* Mark as manually controlled when using flash or effect

* Add comment

* Add RGBW and RGBWW
2023-07-30 18:49:40 +00:00