59 Commits

Author SHA1 Message Date
Franck Nijhof 7edcbff62c Rename entity trigger and condition keys for consistency (#174463) 2026-06-22 19:19:44 +02:00
Erik Montnemery b6b8391cbf Remove purpose-specific triggers and conditions from labs (#174450) 2026-06-22 16:58:51 +01:00
epenet 26d56b8218 Use DOMAIN constant in test (async_setup_component o-z) (#173018) 2026-06-06 12:14:46 -07:00
epenet 90d45432dc Use DOMAIN constant in tests (async_mock_service) (#173002) 2026-06-04 12:35:54 +02:00
Erik Montnemery f8a65a7c6f Rename trigger behavior options (#172348) 2026-05-27 16:01:11 +02:00
Franck Nijhof 833ff982d0 Fix line length violations in tests/components t-z (#170994) 2026-05-17 17:12:29 -04:00
Erik Montnemery 10084c8c0c Add trigger timer.time_remaining (#169763) 2026-05-05 23:54:49 -04:00
Erik Montnemery d3e77d4195 Add timer triggers (#169450) 2026-04-29 16:27:52 +02:00
Erik Montnemery b4bfe6b80b Rename timer last_action to last_transition (#169430) 2026-04-29 11:35:36 +02:00
Erik Montnemery 44e94a82f1 Add last_action state attribute to timers (#168282) 2026-04-29 08:16:19 +02:00
Erik Montnemery aad93fd577 Add tests asserting condition features (#168881) 2026-04-24 18:41:39 +02:00
Erik Montnemery d6be6e8810 Improve timer tests (#168277) 2026-04-15 11:21:59 +02:00
Erik Montnemery fbef3b27bd Add timer conditions (#166641)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2026-03-27 15:39:10 +01:00
karwosts 57c024449c Fix broken invalid_config tests (#148965) 2025-07-18 09:02:44 +02:00
rrooggiieerr 0ffbe076be Fix timer.cancel action fires timer.cancelled event even on canceled timers (#134507)
* Fixes https://github.com/home-assistant/core/issues/116105

* Fixes unit test in accordance to documentation

Timer needs to be active before it can be canceled

* Allow canceling of paused timers

* Add test for canceling/finishing already canceled/finished timers

* Add test for finishing a paused timer, this should not be possible

* Revert finish related tests

* Merge branch 'timer.cancelled_fix' of
git@github.com:rrooggiieerr/homeassistant-core.git into
timer.cancelled_fix

---------

Co-authored-by: Franck Nijhof <git@frenck.dev>
2025-02-11 22:08:18 +01:00
rrooggiieerr 17089e822e Allow timer.finish on paused timers (#134552)
* Add test for finishing already finished timer

* Add test for finishing a paused timer

* Allow canceled timer to be finished
2025-02-11 21:26:13 +01:00
Sid 721b2c2ca8 Enable Ruff PT012 (#113957) 2024-06-08 17:59:08 +02:00
epenet 1317837986 Improve type hints in tests (q-z) (#118381) 2024-05-30 08:48:02 +02:00
epenet 2545b7d3bb Use registry fixtures in tests (t-u) (#118297) 2024-05-28 14:23:01 +02:00
J. Nick Koston d007b175c5 Write timer entity state before firing events (#115151) 2024-04-07 12:51:59 -10:00
Marc Mueller 32f3f46542 Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc Mueller 87165c0d6e Add empty line after module docstring [tests t-z] (#112712) 2024-03-08 14:44:56 +01:00
J. Nick Koston c399cab427 Small speed up to checking core state (#107845) 2024-01-18 08:41:32 -10:00
G Johansson c414e52b55 Change duration for timer.start service to only change running duration (#99628)
* Get back duration for timer

* running duration

* Mods

* Finish

* Fix start call

* remove restore idle

* running duration not None

* fix tests
2023-09-25 08:57:02 +02:00
Erik Montnemery 26fd36dc4c Revert "Deprecate timer start optional duration parameter" (#99613)
Revert "Deprecate timer start optional duration parameter (#93471)"

This reverts commit 2ce5b08fc3.
2023-09-04 20:10:16 +02:00
G Johansson 2ce5b08fc3 Deprecate timer start optional duration parameter (#93471)
* Deprecate timer start option duration parameter

* Add test

* Fix strings

* breaks_in_ha_version

* strings

* Mod string
2023-08-30 11:48:13 +02:00
Jan Bouwhuis 83b0ec5136 Freeze time on timer tests that assert on remaining time (#94078) 2023-06-06 09:18:25 -05:00
G Johansson f7b15dbf84 Fix Timer change service (#93469) 2023-05-31 12:00:45 +02:00
J. Nick Koston fba826ae9e Migrate restore_state helper to use registry loading pattern (#93773)
* Migrate restore_state helper to use registry loading pattern

As more entities have started using restore_state over time, it
has become a startup bottleneck as each entity being added is
creating a task to load restore state data that is already loaded
since it is a singleton

We now use the same pattern as the registry helpers

* fix refactoring error -- guess I am tired

* fixes

* fix tests

* fix more

* fix more

* fix zha tests

* fix zha tests

* comments

* fix error

* add missing coverage

* s/DATA_RESTORE_STATE_TASK/DATA_RESTORE_STATE/g
2023-05-30 20:48:17 -05:00
G Johansson ddb9a6e33c Add change service to timer (#84775)
* Add change service

* test subtract

* Test no change if timer not running

* Modify example

* Raise

* Finalize

* test event

* Fix tests

* Fix tracking time
2023-05-21 10:11:08 +02:00
epenet 88cfbf6a34 Add type hints to integration tests (part 22) (#88234) 2023-02-16 14:08:03 +01:00
epenet 278050a73f Add type hints to integration tests (t-z) (#87707) 2023-02-08 19:10:53 +01:00
epenet 30bf0634fe Add per-file-ignore to pylint (#86289) 2023-01-22 17:26:24 +01:00
Erik Montnemery 4898a41dcf Don't allow partial update of timer settings (#78378) 2022-09-13 14:58:12 -04:00
Erik Montnemery b0d033ef29 Add mixin class CollectionEntity for the collection helper (#77703)
* Add mixin class CollectionEntity for the collection helper

* Improve typing

* Address review comments

* Fix tests
2022-09-03 12:56:49 +02:00
Raman Gupta df4ddc6491 Allow timer state to be restored on restart (#67658) 2022-03-29 23:04:46 -07:00
Franck Nijhof 8aff8d89d2 Clean up async_reproduce_state helper usage (#68617) 2022-03-24 14:40:54 +01:00
Raman Gupta 2791cd68c2 Timer code cleanup (#67604) 2022-03-09 10:42:07 +01:00
Franck Nijhof 5a2b5fe7c5 Yoda assertion style removed is (#48142) 2021-03-20 13:55:10 +01:00
Erik Montnemery b3fecb1c95 Update tests t-z to use async_get() instead of async_get_registry() (#47655) 2021-03-09 14:25:03 +01:00
Franck Nijhof 65cf2fcb6f Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Bram Kragten 4b01ab616a Timer make attribute format always h:mm:ss (#38292)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-09-07 19:12:52 +02:00
Paulus Schoutsen 2af984917e Use asynctest-mock in most places (#35109)
* Use asynctest-mock in most places

* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
Franck Nijhof bc5a2da7b7 Add transition support to scenes, cleanup blocking parameter (#34434) 2020-04-20 18:07:50 -07:00
akasma74 83cc871edf Add force_update to timer integration (#31646)
* force_update added

As per this discussion we need to update last_changed when active timer restarted.
One way to do that is to force HA update the state on each request even if it remains the same.
More details here - https://github.com/home-assistant/architecture/issues/345

* add test for force_update

make sure state_change event fired every time timer (re)started

* remove whitespaces

* remove whitespace

* Update tests/components/timer/test_init.py

Co-Authored-By: Alexei Chetroi <lexoid@gmail.com>

* fix lint

* fix isort

Co-authored-by: Alexei Chetroi <lexoid@gmail.com>
2020-04-02 23:48:41 -07:00
Alexei Chetroi 5fa7d6f22a Allow input_* and timer component setup without config (#30772)
* Allow input_boolean setup without config.

* Allow input_number setup without config.

* Allow input_select setup without config.

* Allow input_text setup without config.

* Allow timer setup without config.
2020-01-14 22:15:59 -05:00
Alexei Chetroi 0a7feba855 Use storage based collections for Timer platform (#30765)
* Use config dict for timer entity.

* Manage timer entities using collection helpers.

* Add tests.

* Make Timer duration JSON serializable.
2020-01-14 15:32:48 -08:00
Paulus Schoutsen 5fdc60e067 Add Safe Mode (#30723)
* Store last working HTTP settings

* Add safe mode

* Fix tests

* Add cloud to safe mode

* Update logging text

* Fix camera tests leaving files behind

* Make emulated_hue tests not leave files behind

* Make logbook tests not leave files behind

* Make tts tests not leave files behind

* Make image_processing tests not leave files behind

* Make manual_mqtt tests not leave files behind
2020-01-14 13:03:02 -08:00
Markus Nigbur 453f7c7294 Fire restarted event on restarting active timer (#30475)
* Fire restarted event on restarting active timer

* Added test for the restart event
2020-01-07 00:00:23 +01:00
Phil Bruckner e233dd7cbe Fix timer with empty config (#30463) 2020-01-04 23:01:58 +01:00