Commit graph

34 commits

Author SHA1 Message Date
Benjamin Auquite
ea2e533186 squash 'flexible service calls' 2023-04-11 19:16:56 -05:00
Benjamin Auquite
9bec45b63c Squashed commit of the following:
commit 1edaf1d7ed
Merge: 0e7e06e a888afd
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 12:57:30 2023 -0500

    Merge branch 'main' into unconventional_sunrise_sunset_times

commit 0e7e06e8a4
Merge: 8fa554a fe7bdd3
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Sat Apr 8 20:23:20 2023 -0500

    Merge branch 'main' into unconventional_sunrise_sunset_times

commit 8fa554a4e7
Merge: ec64eda 39e9d0e
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Sat Apr 8 00:50:16 2023 -0500

    merge

commit ec64eda6bf
Merge: 8353db5 744e43f
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Tue Apr 4 21:08:54 2023 -0500

    Merge branch 'main' into unconventional_sunrise_sunset_times

commit 8353db54cc
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Tue Apr 4 00:56:24 2023 -0500

    tests are unfinished

commit 6cb24116c0
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 3 21:17:01 2023 -0500

    Update switch.py
2023-04-11 19:12:20 -05:00
Benjamin Auquite
7895075e76 Squashed commit of the following:
commit 7069d693b8
Merge: adde5b5 a888afd
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 12:52:19 2023 -0500

    Merge branch 'main' into add-watched-lights

commit adde5b5645
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 10:34:24 2023 -0500

    fix pytest

commit 2c5eaec2d3
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 07:27:25 2023 -0500

    Revert "Update const.py"

    This reverts commit e773af07ca.

commit e773af07ca
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 07:20:23 2023 -0500

    Update const.py

commit c167f59ccd
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 06:09:14 2023 -0500

    Update docs

commit 6220df57d1
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 05:59:26 2023 -0500

    fix the test

commit ff292c2c1b
Merge: 4fdf42b 19d4468
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 05:39:17 2023 -0500

    Merge branch 'add-watched-lights' of https://github.com/basnijholt/adaptive-lighting into add-watched-lights

commit 4fdf42bea1
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 05:39:05 2023 -0500

    small fixes

commit 19d4468f63
Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Date:   Mon Apr 10 10:36:54 2023 +0000

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

commit 70c90181f0
Merge: e30b7de b6a9265
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 10:34:49 2023 +0000

    Merge b6a92650a9 into e30b7debe5

commit b6a92650a9
Merge: 784eed0 ae04ab4
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 05:34:43 2023 -0500

    Merge branch 'add-watched-lights' of https://github.com/basnijholt/adaptive-lighting into add-watched-lights

commit 784eed09b3
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 05:34:33 2023 -0500

    squash merge `alt_detect_method` again

commit ae04ab49a8
Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Date:   Mon Apr 10 10:34:12 2023 +0000

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

commit cfbd65f976
Merge: e30b7de 3c5ea73
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 10:32:34 2023 +0000

    Merge 3c5ea73341 into e30b7debe5

commit 3c5ea73341
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 05:32:27 2023 -0500

    Update switch.py

commit 2f750694d9
Merge: 429251b 7a9dc8f
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 05:31:13 2023 -0500

    Merge branch 'add-watched-lights' of https://github.com/basnijholt/adaptive-lighting into add-watched-lights

commit 429251b45f
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 05:31:04 2023 -0500

    update docs

commit 7a9dc8f24a
Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Date:   Mon Apr 10 10:29:37 2023 +0000

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

commit 37de4244b1
Merge: e30b7de d52ea53
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 10:28:01 2023 +0000

    Merge d52ea53dcc into e30b7debe5

commit d52ea53dcc
Merge: dbc47c8 e30b7de
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 05:27:43 2023 -0500

    Merge branch 'main' into add-watched-lights

commit dbc47c8a36
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 05:26:11 2023 -0500

    Update switch.py

commit 2db675a434
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 05:25:44 2023 -0500

    merge with `alt_detect_method`

    required for this PR

commit dced97b5ca
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 05:21:51 2023 -0500

    merge with `origin\main`
2023-04-11 19:08:49 -05:00
Benjamin Auquite
b6790b14eb Squashed commit of the following:
commit 8dd1b5660e
Merge: 3b3f56f a888afd
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 12:51:11 2023 -0500

    merge origin

commit 3b3f56f2d2
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 12:39:26 2023 -0500

    Update test_switch.py

commit 258964d97b
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Mon Apr 10 12:07:18 2023 -0500

    pass flake8

    move stuff out of `async_setup_entry`

commit 5b6ad02e1d
Merge: 251babc fe7bdd3
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Sat Apr 8 06:01:44 2023 -0500

    Merge branch 'main' into new-service-calls

commit 251babce9d
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Sat Apr 8 05:35:16 2023 -0500

    fixes and now passes tests

commit d9cd74bef3
Author: Benjamin Auquite <halomastar@gmail.com>
Date:   Sat Apr 8 05:15:17 2023 -0500

    initial commit, passes most tests.

    'function too complex'
2023-04-11 19:07:48 -05:00
Bas Nijholt
fe7bdd3940
Add auto_reset_time_remaining attribute (#558)
* Add auto_reset_time_remaining attribute

* fix attr

* Add test
2023-04-08 05:39:08 -05:00
Bas Nijholt
c0c363136b
Test multiple Home Assistant releases and the dev branch (#552)
* Test for multiple Home Assistant versions

* Install ulid-transform

* remove unnecessary unsafe `async_set` from test

* Skip test_state_change_handlers in <2023.4

* Revert "Skip test_state_change_handlers in <2023.4"

This reverts commit 8d01b6ec4e.

---------

Co-authored-by: Benjamin Auquite <halomastar@gmail.com>
2023-04-06 16:36:57 -07:00
Bas Nijholt
59877a0343
Make sure context_id is 26 chars and partially conform to ULID standard (#550) 2023-04-06 12:37:02 -07:00
Benjamin Auquite
cb967aeeb7
Create intentionally over-redundant state_change tests and fix #541 (#544)
* add transition_timer test and debug

* syntax error

* test

* Update switch.py

* Revert "test"

This reverts commit b8009e0a1a.

* Update test_switch.py

* add `create_transition_events` to tests.

nearly done

* tests are done!

* pop is for dictionaries

* Update test_switch.py

* combine the tests

* pin markdown-code-runner

* Pin with '=='

* Update test_switch.py

* pin in the correct place 😅

* Update test_switch.py

* Use timer.is_running

* Update test_switch.py

* ensure timer is running in tests

* this passes the test

* Update test_switch.py

* Do not create new list when not needed

* Remove empty deps

* Remove CONF_ULID_MAX_LENGTH (which is not configurable)

* this shouldn't pass the test but it does.

---------

Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
Co-authored-by: Bas Nijholt <bas@nijho.lt>
2023-04-06 13:53:23 -05:00
Benjamin Auquite
03a2d9cbf6
Fix RGB Color Temp Swaps (#514)
* cherry pick from 486

* Refactor `_add_missing_attributes`

---------

Co-authored-by: Bas Nijholt <bas@nijho.lt>
2023-04-05 18:39:31 -05:00
Benjamin Auquite
c7f44e472f
Correctly wait for transitions (#510)
* 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
Benjamin Auquite
c6a6cd323f
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>
2023-04-03 08:02:06 +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
1ca3bf0f6a
Retroactive review changes for #443 (#485)
* 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
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
Bas Nijholt
1ef55ca180
Use Kelvin instead of Mired, default since core=2022.11 (#375)
* Use Kelvin instead of Mired, default since core=2022.11

* Fix attributes

* Use ATTR_COLOR_TEMP_KELVIN in tests

* use kelvin in tests

* no duplicate

* Round to nearest 5
2022-12-11 16:54:57 -08:00
Bas Nijholt
70899dfe22 Remove area_id from entity_registry.async_get_or_create, closes #356 2022-11-06 15:17:58 -08:00
Bas Nijholt
48b7bc4398 Fix test_area 2022-08-29 19:36:15 -07:00
Bas Nijholt
7bcd70cbec Add TODO to the test 2022-08-29 19:25:04 -07:00
Bas Nijholt
b64c44fc8d Use area_entities to extract entity_ids from area 2022-08-29 18:51:24 -07:00
Bas Nijholt
17061f360f Add test_area test, reproduce issue of #75 2022-08-29 18:28:54 -07:00
Bas Nijholt
6b3686696b Fix pre-commit issues 2022-08-29 09:25:38 -07:00
Bas Nijholt
2661765990 Remove test_expand_light_groups 2022-08-28 22:25:13 -07:00
Bas Nijholt
f198071584 Use variable 2022-08-28 22:24:36 -07:00
Bas Nijholt
60179cbe38 Fix test_separate_turn_on_commands 2022-08-28 22:02:52 -07:00
Bas Nijholt
bc825f035c Remove fixture that is not neede 2022-08-28 16:12:12 -07:00
Bas Nijholt
26bce85318 Setup demo platform 2022-08-28 16:11:23 -07:00
Bas Nijholt
01fd7f96e2 Run all pre-commit filters 2022-08-28 15:08:03 -07:00
Bas Nijholt
5c760b5f4a call platform.init() 2022-08-28 15:07:07 -07:00
Bas Nijholt
b6309e89d3 Fix assert and block till done 2022-08-28 14:44:24 -07:00
Bas Nijholt
4baa564f42 Fix setting up lights 2022-08-28 14:39:53 -07:00
Bas Nijholt
0016818beb Fix TZ test 2022-08-28 14:13:33 -07:00
Bas Nijholt
b9ff3d6f9a Try to copy over files 2022-08-28 13:42:55 -07:00
Bas Nijholt
a9428ed936 Fix PYTHONPATH 2022-08-28 12:36:37 -07:00
Bas Nijholt
10e16dc40f Copy tests from https://github.com/home-assistant/core/pull/40626 2022-08-28 12:05:31 -07:00