Commit graph

649 commits

Author SHA1 Message Date
Benjamin Auquite
c7f44e472f
Correctly wait for transitions (#510) 1.10.0
* Add auto_reset_manual_control with async timer

* cherry-pick wait for transition stuff

* Update switch.py

* not renamed in this branch yet.

* Update switch.py

* update tests

* Update switch.py

* merge related fix

* cleanup

* Revert "cleanup"

This reverts commit 3aa2f3242b.

* Update switch.py

* Update switch.py

* Update switch.py

* Small refactor

* Move test to old position for better diffs

* Revert "Small refactor"

This reverts commit b986b3f77c.

* Update README.md

* fix the test

last_state_change isn't updated quick enough.

* #510 changes (#516)

* Change (WIP)

* Update test_switch.py

* Refactor

* Revert "Revert "Small refactor""

This reverts commit 3731c99936.

* Update README.md

* Fix the test

* Bump to 1.9.0 (#518)

* Basic community fixes PR (#460)

* Fixes #423

#423

* Do not adapt lights turned on with custom payloads.

* Update switch.py

* Issue fixes

#423, #378, #403, #449

* quickly test #274

* Revert feature requests, this branch only has fixes.

Reverted FR 274

* pre-commit fix

* Create automerge.yaml

* test

* Delete automerge.yaml

My bad.

* Fix #460 and #408

* see @basnijholt 's comment in #450.

* @basnijholt requested changes.

---------

Co-authored-by: Bas Nijholt <bas@nijho.lt>

* Undo accidental changes introduced in #509, but adds the changes from #460 (#521)

* Release 1.9.1 (#522)

* Bump to 1.9.1

* Add CODEOWNERS

---------

Co-authored-by: Benjamin Auquite <halomastar@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* No need to wrap the reset

* Remove unused attrs

* Shorter log message

* revert unrelated tests change

* remove unused function

* Use patch

* Bump to 1.10.0

---------

Co-authored-by: Bas Nijholt <bas@nijho.lt>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
2023-04-03 17:04:06 -07:00
Bas Nijholt
b730c7cc90
Add scripts to auto update en.json, strings.json and services.yaml (#520)
* Add scripts to auto update strings.json and services.yaml

* Run services

* simplify

* Run strings

* rerun

* revert

* allow unicode

* Add CODEOWNERS

* Update CODEOWNERS

* set CONF_USE_DEFAULTS docs

* add field_name

* Auto run scripts

* Update desc

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

* double quotes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

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

* Add newline

* sync changes between en.json and strings.json

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

* double quotes

* fix

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

* Add comments

* Remove comments

* shorter

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

* Rephrase

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

* remove key from desc

---------

Co-authored-by: Benjamin Auquite <halomastar@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-04-03 14:59:14 -07:00
Bas Nijholt
26974c8fd5
Simplify if-statement, (small #460 fix) (#526) 2023-04-03 13:32:38 -05:00
Bas Nijholt
d768a1e825
Release 1.9.1 (#522) 1.9.1
* Bump to 1.9.1

* Add CODEOWNERS
2023-04-03 02:07:05 -07:00
Bas Nijholt
0958feb744
Undo accidental changes introduced in #509, but adds the changes from #460 (#521) 2023-04-03 03:47:01 -05:00
Benjamin Auquite
c6a6cd323f
Basic community fixes PR (#460) 1.9.0
* Fixes #423

#423

* Do not adapt lights turned on with custom payloads.

* Update switch.py

* Issue fixes

#423, #378, #403, #449

* quickly test #274

* Revert feature requests, this branch only has fixes.

Reverted FR 274

* pre-commit fix

* Create automerge.yaml

* test

* Delete automerge.yaml

My bad.

* Fix #460 and #408

* see @basnijholt 's comment in #450.

* @basnijholt requested changes.

---------

Co-authored-by: Bas Nijholt <bas@nijho.lt>
2023-04-03 08:02:06 +00:00
Bas Nijholt
87391e6d24
Bump to 1.9.0 (#518) 2023-04-03 01:01:58 -07:00
Bas Nijholt
19fcb1d6b9
Automatically generate more service tables in the README (#509)
* Automatically sync more data

* Automatically generate apply table

* Generate manual control

* Add manual control docs

* Update README.md

* Move docs functions to separate file

* Update code

* simple

* no path

* link paths

* Fix link

* missed

* cd core

* Update README.md

* Allow alternative docs

* update readme

* More special

* Fx

* Update README.md

* Remove common descriptions

* Update README.md

* Update README.md

* Rephrase

* Update README.md

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-03 00:58:39 -07:00
allcontributors[bot]
cdc3585a66
docs: add igiannakas as a contributor for code (#517)
* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2023-04-03 07:58:20 +00:00
igiannakas
9caf3048f1
Continue to adapt color temperature down to the sleep temperature after sunset (#87)
* Update switch.py

Continue to adapt color temperature down to the sleep temperature after sunset. Results in a gradually warming light during the night time rather than a fixed color temperature throughout the night time.

* Run pre-commit

* Merge branch 'master' into pr/87

* add config option bool `adapt_until_sleep` defaulting to `false`

---------

Co-authored-by: Bas Nijholt <bas@nijho.lt>
Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
Co-authored-by: Benjamin Auquite <halomastar@gmail.com>
2023-04-03 07:27:07 +00:00
Benjamin Auquite
c915bda9b9
Autoreset_Control_Time - small changes (#515)
* small changes

* Update README.md

* trivial comment change

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
2023-04-03 06:57:12 +00:00
Bas Nijholt
ea2a6b0173
Add auto_reset_manual_control with async timer (#487)
* Add auto_reset_manual_control with async timer

* Add failing test

* Debugging

* Refactor find_switch_for_lights

* Revert changes in is_manually_controlled

* style

* Fix test_manual_control

* add types

* fixes

* dict

* make all tests pass

* text

* Rework find_switch_for_lights

* Style

* Better check

* revert, do in other test!

* No need to log when raising

* Add type hint

* Suggestion https://github.com/basnijholt/adaptive-lighting/pull/488/files#r1152408541 by @th3w1zard1

* Small fixes

* document new config everywhere (#496)

* chore(docs): update TOC

* undo change

* fi

* Update README.md

* Update README.md

* chore(docs): update TOC

* Update README.md

* Use markdown-code-runner

* Remove

* Use markdown-code-runner instead of packaged solution

* fix comment

* Only commit when needed

---------

Co-authored-by: Benjamin Auquite <halomastar@gmail.com>
Co-authored-by: basnijholt <basnijholt@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-03 02:22:23 +00:00
Bas Nijholt
ccf18c3879
Bump to 1.8.0 (#508) 1.8.0 2023-04-02 19:17:35 -07:00
Benjamin Auquite
b081d79b86
Update services.yaml (#497)
Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
2023-04-02 18:57:11 -07:00
Bas Nijholt
9e5e9a49e5
Sync main branch to master (#507) 2023-04-02 18:56:56 -07:00
Bas Nijholt
8108bd0a4b
Use markdown-code-runner instead of packaged solution (#505)
* Use markdown-code-runner instead of packaged solution

* add debug
2023-04-02 18:56:36 -07:00
Bas Nijholt
cc8ce29a8a
Auto-generate the configuration options documentation (#498)
* Autogenerate the documentation and strings

* Line limit

* Split

* Happy pre-commit

* Split up workflows

* Generate table function

* raise

* Add gen script

* chore(docs): update TOC

* Add gen script

* path

* Run - name: Install Home Assistant

* chore(docs): update TOC

* add copyright

* Fix branch name

* Run on PRs

* dev

* remove steps

* use matrix

* Run script

* chore(docs): update TOC

* Try fixing CI

* fix

* test

* refactor

* chore(docs): update TOC

* fix

* update

* use v3

* rename

* Fix input

* fix pytest

* fix path

* paths

* Change to github.head_ref

* More backticks

* Add extra text

* chore(docs): update TOC

* backticks

* Update README.md

---------

Co-authored-by: basnijholt <basnijholt@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-01 23:43:20 -07:00
Benjamin Auquite
ec558e5616
Move include_config_in_attributes 2023-04-01 16:35:01 -07:00
Bas Nijholt
26c19525cd
Rewrite the README (#492)
* Rewrite the README

* More changes

* More

* Rewrites

* Test collapse

* test

* Fix

* backticks

* Rewrite options

* emoji headings

* chore(docs): update TOC

---------

Co-authored-by: basnijholt <basnijholt@users.noreply.github.com>
2023-03-30 20:58:29 +00:00
Bas Nijholt
2de4b7415b
Refactor find_switch_for_lights and more small refactors (#488)
* Refactor find_switch_for_lights

* Refactor

* style

* renames
2023-03-29 23:47:57 -05:00
Bas Nijholt
1ca3bf0f6a
Retroactive review changes for #443 (#485) 1.7.0
* Retroactive review changes for #443

* Move up __init__

* Add test for test_change_switch_settings_service

* Add docs

* Add test for defaults

* Remove unused function

* Add skip var

* move pylint marker

* Refactor validate

* Update README.md

---------

Co-authored-by: Benjamin Auquite <halomastar@gmail.com>
2023-03-27 20:56:54 -05:00
Benjamin Auquite
c05e0cc244 Change attributes in AdaptiveSwitch via service call (#443) 2023-03-27 09:05:24 -07:00
Bas Nijholt
0127496441
Add example of how to pass command line args (#483) 2023-03-27 05:47:50 +00:00
Bas Nijholt
eb43e1755e
Use ENTRYPOINT and CMD (#482) 2023-03-27 05:07:07 +00:00
Bas Nijholt
85461ea856
Always color the logs and print coverage report (#481) 2023-03-27 04:37:21 +00:00
Bas Nijholt
491aca696c
Add linux/arm64 to build platform of Docker image (#476)
* Add linux/arm64 to build platform of Docker image

* Fix url
2023-03-27 03:00:12 +00:00
Bas Nijholt
aa282c83b2
Fix Markdown URL (#479) 2023-03-26 19:50:40 -07:00
Bas Nijholt
1fb364949e
Fix name of Docker image (#478) 2023-03-27 02:39:57 +00:00
Bas Nijholt
f408f330c1
Disable Docker image builds on ARM for now (#475) 2023-03-26 19:14:19 -07:00
Bas Nijholt
8b3a9d6755
Try installing extra deps such that bcrypt and cryptography can be installed in arm/v7 (#474) 2023-03-27 01:50:49 +00:00
Bas Nijholt
a523cccb04
Add command to print pytest with colors in Docker (#473) 2023-03-27 01:46:36 +00:00
Bas Nijholt
87af937f41
Set clone depth=1 to speedup the cloning of home-assistant/core (#472) 2023-03-27 01:38:20 +00:00
Bas Nijholt
36154ca606
Format the Markdown table in README.md (#471) 2023-03-27 01:21:00 +00:00
Bas Nijholt
1b08e8e6ba
Add testing Dockerfile (#470)
* Add testing Dockerfile

* Add comments

* Format table

* Add tests/README.md

* Rephrase

* add note in dockerfile
2023-03-27 01:18:18 +00:00
Benjamin Auquite
7486110e3e
manually edited files for new commit. (#468)
Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
2023-03-26 15:16:00 -07:00
Benjamin Auquite
06dcdbb4a4
Fix the broken tests (#467)
* Update test_dependencies.py

pytest reversion todo in later commit

* increase verbosity for analysis

* "instance" was created in the basic features PR.

* Can't stand the deprecation warnings.

* add testing steps to workflow action in logs.

Help the next person running into this issue again.

* wording in new messages.

* Manifest keys should be sorted: domain, name, then alphabetical order

* return basnijholt's original settings.

replaced `-v` with `-qq` again in `pytest.yaml`,
returned `branches: [master]` in both yaml files.

* Forgot a comma

* Update version in manifest to 1.6.0

* @th3w1zard1 is a code owner!

* Update .gitignore

* Revert "Update .gitignore"

This reverts commit 172841d356.
2023-03-26 15:04:13 -07:00
allcontributors[bot]
66e65e2fe7
docs: add raman325 as a contributor for code (#466)
* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2023-03-25 20:41:56 -07:00
allcontributors[bot]
97e2e27a9b
docs: add firstof9 as a contributor for code (#465)
* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2023-03-25 20:28:22 -07:00
Benjamin Auquite
08ff04141e
Feature requests: Switch now optional for service calls | New default icons | Reload .yaml w/o restart | adapt_delay ms (#459) 1.6.0
* added #274

* attempt getSwitchFromLightId()

* Update switch.py

* changed from register_entity_service to hass.services.async_register

* Update switch.py

* Update switch.py

* Update switch.py

* Update switch.py

* Update switch.py

* Update switch.py

* Update services.yaml

* Update switch.py

* test

* test builds ready

* target selector may not be possible with current syntax

priority is backwards-compatibility as I know most people will smash that update button

* expanded light groups

* test builds ready

* add feature #104

* Update custom_components/adaptive_lighting/switch.py

Co-authored-by: Chris <firstof9@gmail.com>

* Might as well type both. No reason not to.

Co-authored-by: Chris <firstof9@gmail.com>

* Might as well type both. No reason not to.

Co-authored-by: Chris <firstof9@gmail.com>

* Reformatted debug messages.

Reimported ServiceCall as suggested

* Multiple switches allowed again in services.

Apparently this was possible before.

With this change, the `lights` argument must not be passed with multiple switches, or the integration has no way of knowing what the user wants to do. Integration did not make this check in prior versions.

Also reformatted the debug messages.
Removed `automerge.yaml` (my apologies)

* Reload config without restart.

You can now reload any changes to the yaml file without restarting your home assistant. Should show a 'reload' button in your integrations page or you can call the homeassistant reload integration service call.

See https://community.home-assistant.io/t/how-to-allow-custom-compontent-for-yaml-configuration-reloading/391190/4

* Use snake_case for function name 'parseServiceArgs'

* Slight rephrase

* Small style changes

* Rephrased debug messages.

Removed `integration_entities` as we rewrote the code from that function already in parse_service_args. Reference function now above parse_service_args.

* removed: `these_switches = data = None`

* Factor out _find_switch_with_lights

* Rename function and add log statement

* Remove pylint marker

* Handle multiple switches found

* Small changes

* Rename _parse_service_args to _get_switches_from_service_call

* Rephrase log messages

* Add type hint

---------

Co-authored-by: Chris <firstof9@gmail.com>
Co-authored-by: Bas Nijholt <bas@nijho.lt>
2023-03-25 20:22:05 -07:00
allcontributors[bot]
5552f5ec89
docs: add skycarl as a contributor for doc (#464) 1.5.0
* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2023-03-25 19:12:47 -07:00
Skyler Carlson
c8ab1df741
Fix sunrise vs sunset typo (#458)
Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
2023-03-25 19:11:51 -07:00
allcontributors[bot]
8c630c995a
docs: add th3w1zard1 as a contributor for code (#463)
* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2023-03-25 12:46:10 -07:00
Benjamin Auquite
231e7c197d
Show config options on the switch as attributes with include_config_in_attributes option (#445)
* Switch attributes now show the config settings.

`sunset_time`, `sunrise_time`, `max_sunrise_time`, and `min_sunset_time` show 'null' when not overridden - TODO

* fixed basnijholt's requested issues

* Run pre-commit

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* 'configuration' attr holds list of config options

returned the `=` from basnijholt's review.

* Small style changes

* Add include_config_in_attributes to en.json

---------

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-03-25 12:43:51 -07:00
Bas Nijholt
393885a019
Do not test on Python 3.9, which Home Assistant no longer supports (#429) 2023-02-12 14:40:38 -08:00
Bas Nijholt
7fefa7de96
Update pre-commit filters (#432) 2023-02-12 14:37:40 -08:00
allcontributors[bot]
c3f26a3685
docs: add brebtatv as a contributor for translation (#431)
* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2023-02-12 14:34:42 -08:00
Tomáš Valigura
738e7957c6
Add files via upload (#422)
Please add a Czech translation. Translated with love in collaboration with Jitka Kravcová.

Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
2023-02-12 14:33:21 -08:00
allcontributors[bot]
53455f15a7
docs: add deviantintegral as a contributor for doc (#428)
* docs: update README.md

* docs: update .all-contributorsrc

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
2023-02-12 14:28:56 -08:00
Andrew Berry
6482fc54c2
Add troubleshooting steps for lights (#427)
* Fix skipping heading level

* Add troubleshooting for when lights misbehave

* Rephrase Zigbee groups troubleshooting section

Co-authored-by: Andrew Berry <andrew@furrypaws.ca>

---------

Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
2023-02-12 14:28:37 -08:00
Bas Nijholt
7ee7dfe570
Rename ci.yaml to pytest.yaml 2023-01-12 12:42:33 -08:00