Commit graph

387 commits

Author SHA1 Message Date
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
Bas Nijholt
9ed588816c Fix translations 2022-08-31 23:18:09 -07:00
Bas Nijholt
c78d1bec75 Fix setting RGB light in sleep 2022-08-31 23:18:09 -07:00
Bas Nijholt
4a6c966a53 Change order 2022-08-31 23:18:09 -07:00
Bas Nijholt
8965e6becf Ugly first implementation 2022-08-31 23:18:09 -07:00
Bas Nijholt
f500a3758e Update to translations and cleanup 2022-08-31 23:18:09 -07:00
Bas Nijholt
37304f3d35 test 2022-08-31 23:18:09 -07:00
Bas Nijholt
29a4b8a33c Add selection between RGB and color temp 2022-08-31 23:18:09 -07:00
Bas Nijholt
d3dce3166e Add strings and options 2022-08-31 23:18:09 -07:00
Bas Nijholt
7d10259bc8 Use RGB selector 2022-08-31 23:18:09 -07:00
Bas Nijholt
6fd16e34f4 Run pre-commit 2022-08-30 11:35:25 -07:00
awashingmachine
898be636fd Merge branch 'master' of https://github.com/basnijholt/adaptive-lighting 2022-08-30 20:17:26 +02:00
awashingmachine
6dc90ea81d Adds italian translation 2022-08-30 20:17:05 +02:00
Bas Nijholt
c0bc8d23da Bump to 1.0.20 2022-08-30 10:49:24 -07:00
Bas Nijholt
26797b677d Make sure that 'settings' dict is populated when switch is off
Closes #249 and #190
2022-08-30 10:48:34 -07:00
Bas Nijholt
1642ae8da3 Bump to 1.0.19 2022-08-30 10:34:36 -07:00
Bas Nijholt
dee6eed67f Take care of the turn_on_event not having registered an event for entity_id 2022-08-30 10:29:32 -07:00
Bas Nijholt
f049c8d5db
Merge pull request #324 from basnijholt/service_data_empty
Take care of edge case where no area_id or entity_id in service_data
2022-08-30 09:50:26 -07:00
Bas Nijholt
52220b0328 Bump version to 1.0.18 2022-08-30 09:46:13 -07:00
Bas Nijholt
9e22e70d63 Take care of edge case where no area_id or entity_id in service_data 2022-08-30 09:45:05 -07:00
Gleb
c208139aa1
Adds Russian translation 2022-08-30 13:04:21 +03:00
Bas Nijholt
1fd6787505 Bump version to 1.0.17 2022-08-29 19:40:14 -07:00
Bas Nijholt
acd506aeeb Only add the lights for an area 2022-08-29 19:07:34 -07:00
Bas Nijholt
b64c44fc8d Use area_entities to extract entity_ids from area 2022-08-29 18:51:24 -07:00
Bas Nijholt
b9f28dd0ab Fix linting issues 2022-08-29 09:30:20 -07:00
Bas Nijholt
dd141d2335
Merge pull request #239 from MangoScango/delay
Avoid flickering on light turn on with a configurable delay
2022-08-29 09:29:51 -07:00