Commit graph

412 commits

Author SHA1 Message Date
Benjamin Auquite
26c32ac3d8
Merge 3731c99936 into 9caf3048f1 2023-04-03 07:36:57 +00:00
Bas Nijholt
3731c99936 Revert "Small refactor"
This reverts commit b986b3f77c.
2023-04-03 00:32:33 -07: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
Bas Nijholt
b986b3f77c Small refactor 2023-04-03 00:20:12 -07: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
Benjamin Auquite
4479761ad7 Update switch.py 2023-04-03 01:50:52 -05:00
Benjamin Auquite
2f0bad82ff Update switch.py 2023-04-03 01:40:29 -05:00
Benjamin Auquite
cebf31a203 Update switch.py 2023-04-03 01:35:53 -05:00
Benjamin Auquite
836595051d Revert "cleanup"
This reverts commit 3aa2f3242b.
2023-04-03 01:02:42 -05:00
Benjamin Auquite
3aa2f3242b cleanup 2023-04-03 00:55:21 -05:00
Benjamin Auquite
732fc17c7f merge related fix 2023-04-02 23:56:08 -05:00
Benjamin Auquite
1571dfaeda Update switch.py 2023-04-02 23:46:20 -05:00
Benjamin Auquite
30c62bf759 Update switch.py 2023-04-02 23:28:58 -05:00
Benjamin Auquite
8e847e71eb not renamed in this branch yet. 2023-04-02 23:15:53 -05:00
Benjamin Auquite
22bae9ed84 Update switch.py 2023-04-02 23:08:35 -05:00
Benjamin Auquite
8b2fcf93be cherry-pick wait for transition stuff 2023-04-02 23:04:26 -05:00
Benjamin Auquite
d7aecc9e7f
Merge branch 'main' into wait_for_transitions 2023-04-02 23:01:32 -05: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) 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
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
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
52275bfee3 Add auto_reset_manual_control with async timer 2023-03-28 00:19:35 -07: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
c05e0cc244 Change attributes in AdaptiveSwitch via service call (#443) 2023-03-27 09:05:24 -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
Benjamin Auquite
08ff04141e
Feature requests: Switch now optional for service calls | New default icons | Reload .yaml w/o restart | adapt_delay ms (#459)
* 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
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
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
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
Bas Nijholt
ce4503c9c6
Also trigger manual control when using "color_temp" in mired format (#402) 2022-12-11 17:23:08 -08:00
Bas Nijholt
dc8fa60e75 Bump to 1.4.0 2022-12-11 16:56:14 -08: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
ngommers
8ed8531610
Create nl.json (#399)
add dutch language
2022-12-11 09:35:27 -08:00
Bas Nijholt
5c4ce3cae6
bump to version 1.3.0 2022-12-07 12:46:28 -08:00
Mark Niemeyer
97bb2cf3de use send_split_delay also when no transition is used 2022-11-27 20:37:28 +01:00
Mark Niemeyer
ff6494240d add a delay between sending of commands when using separate_turn_on_commands 2022-11-27 20:37:28 +01:00
Mark Niemeyer
040d576948 update german translation 2022-11-27 17:30:28 +01:00
Bas Nijholt
fee8654e9f Fix typos in en.json and strings.json 2022-11-08 16:47:52 -08:00
Bas Nijholt
1d489455f0 Bump to 1.2.0 in manifest.json 2022-11-08 10:38:31 -08:00
Bas Nijholt
60b1be43db Run pre-commit filters 2022-11-08 09:11:32 -08:00
Sören Beye
d0010740ca Add max_sunrise_time and min_sunset_time overrides 2022-11-08 17:37:57 +01:00
danaues
c24ac4e615 linting, sub string for constant 2022-10-29 23:58:03 +00:00
danaues
14019695a4 add error logging and display error to user 2022-10-29 23:45:29 +00:00
Bas Nijholt
45f2085457 Fix pre-commit issues 2022-10-27 21:57:49 -07:00
danaues
24c2800d67 fix missing configured light entries in options 2022-10-28 02:27:37 +00:00
awashingmachine
ab32139b07
Merge branch 'basnijholt:master' into master 2022-09-01 12:11:03 +02:00
awashingmachine
0efb467a29 Update it.json 2022-09-01 12:10:27 +02:00
Bas Nijholt
07a0dec203 Bump to 1.1.0 2022-08-31 23:19:40 -07:00