* Fix trailing spaces in const.py: restore correct one, remove incorrect one
* Also remove trailing space from translations/en.json
* Also remove trailing space from strings.json
* 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>
* 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>
* Fixes in maybe_cancel_adjusting to possibly fix accidental turn on
* simplify logic in maybe_cancel_adjusting
* Add logging statements
* only control if turn_on called
* more logs
* add TODO
* Add _state_event_is_from_our_turn_on
* Ignore off->on state switches that are not accociated with light.turn_on
* improve logging
* rename
* Update docs
* Update README.md, strings.json, and services.yaml
* Add caution message to README
* Change order of emojis
* Update README.md, strings.json, and services.yaml
* Check that platform is not None
* log the call
* fix args
* Do not re-add already added configs
* Do not re-add already added configs
* Use async_remove
* remove unused code
* [pre-commit.ci] pre-commit autoupdate (#627)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.279 → v0.0.280](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.279...v0.0.280)
- [github.com/psf/black: 23.3.0 → 23.7.0](https://github.com/psf/black/compare/23.3.0...23.7.0)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bas Nijholt <basnijholt@gmail.com>
* Extra logging statement
* Add to README
* log context_id
* return right indent
* move comment
* Skip on self.manager.is_proactively_adapting
---------
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>
* 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>
* 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>
* 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>
Option to set a delay between when a lightstate off -> on event is detected, and lights are adapted. Trying to adapt lights that are still going through their initial turning on fade in transition can cause flickering, so setting this to a number higher than the transition time avoids the problem.