Commit Graph

298 Commits (c4d8cda92be330311fd83809588c7e0131d1c49b)

Author SHA1 Message Date
Stefan Agner 9ab69aa41c
Add mWh as unit of measurement for Matter energy sensors (#133005) 2024-12-13 09:33:58 +01:00
epenet 7bdf034b93
Migrate template light tests to use Kelvin (#133025) 2024-12-12 13:54:22 +01:00
G Johansson 2eaf206562
Implement new state property for vacuum which is using an enum (#126353)
* Implement new state property for vacuum which is using an enum

* Mod

* Mod init

* Mods

* Fix integrations

* Tests

* Fix state

* Add vacuum tests

* Fix last test

* Litterrobot tests

* Fixes

* Tests

* Fixes

* Fix VacuumEntity

* Mods

* Mods

* Mods

* Update demo

* LG

* Fix vacuum

* Fix Matter

* Fix deprecation version

* Mods

* Fixes

* Fix ruff

* Fix tests

* Fix roomba

* Fix breaking dates
2024-12-06 11:16:03 +01:00
G Johansson 3464ffc53e
Add open to Template lock (#129292)
* Add open to Template lock

* Update from review
2024-11-27 13:26:57 +01:00
Martin Hjelmare ccbbcbb264
Make set value template number option required (#131625) 2024-11-26 19:27:59 +01:00
Sid 9e98e446a2
Bump ruff to 0.8.0 (#131273) 2024-11-22 16:53:26 +01:00
G Johansson d0ad834d93
Move manual trigger entity tests (#130134) 2024-11-10 12:14:13 +01:00
Jakob Schlyter cd11f01ace
Add support for MW/GW/TW and GWh/TWh (#130089) 2024-11-08 22:12:16 +01:00
Paulus Schoutsen a927312fb5
Ensure all template names are strings (#129921) 2024-11-05 22:36:26 -05:00
G Johansson cdfec7ebb4
Implement new state property for alarm_control_panel which is using an enum (#126283)
* Alarm state from enum

* Fixes

* Set final

* Fix rebase

* Test const

* Fix breaking version

* Fix other for alarm_control_panel

* Fix integrations

* More

* More

* More

* More

* Fix zha

* Replace _attr_state

* Fix alarm_control_panel

* Fix tests

* Fixes

* Mods

* Change some

* More

* More

* More

* Tests

* Last tests

* Return enum

* Fix zha

* Remove not needed check

* Fix wording

* Fix homekit

* Mod prometheus

* Fix mypy

* Fix homekit

* Fix ifttt
2024-10-21 22:54:27 +02:00
epenet 838519e89f
Use STATE_ON/STATE_OFF constants in template test (#128883) 2024-10-21 16:19:44 +02:00
epenet be4641b8f3
Push real binary sensor states to state machine in tests (#128894) 2024-10-21 16:19:25 +02:00
G Johansson 666e8e133e
Cover state is enum (#127144)
* Change light state to use enum

* Adjust cover tests

* Update cover

* Fix covers

* Some tests

* More tests

* Fix tests

* Fix
2024-10-08 18:39:04 +02:00
Tudor Sandu d9b077154e
Blueprints for template entities (#126971)
* Template domain blueprints

* Default blueprint for templates

* Some linting

* Template entity updates

* Load and use blueprints in config

* Added missing mapping methods for templates

* Linting

* Added tests

* Wrong schema type

* Hassfest errors

* More linting issues

* Refactor based on desired schema

In the [architecture discussion](https://github.com/home-assistant/architecture/discussions/1027), the template blueprint instance did not specify the platform (e.g. `binary_sensor`), but the initial implementation assumed that schema.

* Create default template blueprints on first run

* Moved TemplateConfig definition

This is to avoid circular references

* Corrected methods to find templates based on blueprints

* Corrected missing entity config information

* Added tests

* Don't use hass.data

Address comments https://github.com/home-assistant/core/pull/126971/#discussion_r1780097187

* Prevent creating blueprints during testing

* Combine 2 ifs

Address comment https://github.com/home-assistant/core/pull/126971/#discussion_r1780160870

* Improve test coverage

* Prevent template component from dirtying test env

* Remove useless hard-coded validation

* Improve code coverage to 100%

* Address review comments

* Moved helpers in helpers.py

As per comment https://github.com/home-assistant/core/pull/126971#discussion_r1786539889

* Fix blueprint source URL

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-10-04 16:47:29 +02:00
Paul Bottein c306ebed49
Fix device id support for alarm control panel template (#127340) 2024-10-02 19:04:36 +02:00
epenet 6c539cd2d8
Improve type hints in template config_flow tests (#126803)
Improve type hints in template tests
2024-09-26 19:25:33 +02:00
epenet 5fb9537d6d
Use pytest.mark.usefixtures for start_ha in template tests (#126805) 2024-09-26 14:00:52 +02:00
G Johansson 93aade6e8e
Change lock state to an enum (#126379)
* Add new LockState enum for lock states

* Add rest

* Fix insteon tests

* Fix mqtt tests

* Fix tesla_fleet

* Revert back ST_STATE_LOCKED

* Add back constant
2024-09-24 12:30:50 +02:00
G Johansson 2080b9a87c
Add config flow to template alarm_control_panel (#125861)
* Add config flow to template alarm_control_panel

* Remove commented code

* Test import
2024-09-13 22:12:16 +02:00
G Johansson d855f70e3b
Add RestoreEntity to template alarm_control_panel (#125844) 2024-09-13 16:44:48 +02:00
chammp b3377fe5fb
Add condition to trigger template entities (#119689)
* Add conditions to trigger template entities

* Add tests

* Fix ruff error

* Ruff

* Apply suggestions from code review

* Deduplicate

* Tweak name used in debug message

* Add and improve type annotations of modified code

* Adjust typing

* Adjust typing

* Add typing and remove unused parameter

* Adjust typing

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Adjust return type

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-09-11 09:36:49 +02:00
chammp 56dfb2c734
Add unit_of_measurement to template numbers (#122862) 2024-09-11 08:47:17 +02:00
Sergey Dudanov dcd7830a35
Add calories to energy sensor device class (#122796)
* added calories to energy class

* changes

* temporarily solving the problem with conversion accuracy

* add tests

* added calories to energy class

* changes

* add tests

* Update homeassistant/util/unit_conversion.py

Co-authored-by: Robert Resch <robert@resch.dev>

* Update homeassistant/util/unit_conversion.py

Co-authored-by: Robert Resch <robert@resch.dev>

* apply suggestions

* Update homeassistant/util/unit_conversion.py

---------

Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-09-10 12:22:15 +02:00
epenet af6434a533
Add alias to DOMAIN import in tests [n-z] (#125581) 2024-09-09 15:14:05 +02:00
Jason Hunter 513361ef0f
Fix failing template config flow tests (#125534)
fix: failing template config flow tests
2024-09-08 21:38:31 +02:00
Erik Montnemery cf049a07c2
Don't allow templating min, max, step in config entry template number (#125342) 2024-09-06 07:59:22 +02:00
Joost Lekkerkerker 8c2e63807c
Make set_value required in number template (#124917)
* Make set_value required in number template

* Make set_value required in number template

* Fix tests
2024-08-30 22:02:10 +02:00
epenet 3dc83ef19d
Add missing hass type hint in component tests (t) (#124274) 2024-08-20 12:55:39 +02:00
dougiteixeira f581066747
Add config flow for platform number in Template (#121849)
* Add config flow to select platform in Template

* Remove device id duplicate in schema

* Add config flow for number platform in Template

* Remove mode
2024-08-15 20:02:51 +02:00
epenet 67f761c0e9
Improve type hints in template tests (#123915) 2024-08-14 14:58:16 +02:00
Erik Montnemery dc462aa529
Remove unnecessary assignment of Template.hass from template (#123773) 2024-08-13 11:54:36 +02:00
Joost Lekkerkerker e8d7eb05ae
Delete unused snapshots (#123656)
* Delete unused snapshots

* Delete unused snapshots
2024-08-12 13:28:09 +02:00
Erik Montnemery b973455037
Fix template image test affecting other tests (#122849) 2024-07-30 16:28:55 +02:00
Erik Montnemery d9e996def5
Fix template binary sensor test (#122855) 2024-07-30 16:18:47 +02:00
Marc Mueller a6068dcdf2
Update import locations in tests (#122216) 2024-07-20 11:16:04 +02:00
dougiteixeira 162b734be7
Add config flow for select platform in Template (#121809) 2024-07-12 17:50:02 +02:00
dougiteixeira 52454f5218
Add config flow for platform switch in Template (#121639) 2024-07-11 10:11:31 +02:00
dougiteixeira e0c7073da1
Add config flow for image platform in Template (#121648) 2024-07-10 23:49:24 +02:00
dougiteixeira d783813ba0
Add config flow for platform button in Template (#120886) 2024-07-09 21:20:18 +02:00
dougiteixeira 4289efb506
Device change test improvements in Template (#120884) 2024-07-05 14:47:31 +02:00
dougiteixeira 10edf85311
Update `test_device_cleaning` in Template (#120163) 2024-06-22 15:59:46 +02:00
dougiteixeira 6e32a96ff3
Add the ability to bind the template helper entity to a device (#117753) 2024-06-22 12:45:06 +02:00
G Johansson b6b6248713
Remove legacy get forecast service from Weather (#118664)
* Remove legacy get forecast service from Weather

* Fix tests

* Fix test

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-06-17 21:13:28 +02:00
epenet 3d1165519d
Fix broad-exception-raised in component tests (#119467) 2024-06-12 17:53:42 +02:00
epenet 99b349fa2c
Fix consider-using-dict-items warnings in tests (#119497) 2024-06-12 16:44:29 +02:00
epenet fb1b0058ee
Fix consider-using-tuple pylint warnings in component tests (#119464)
* Fix consider-using-tuple pylint warnings in component tests

* Apply su

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>

---------

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
2024-06-12 15:50:27 +02:00
chammp 52379ad7cb
Add code_format_template to template locks (#106947)
* Add code_format to template locks

* Replace code_format with code_format_template

* Add test case for template eval to None

* Apply suggestion to not call super()

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Add more negative tests

* Handle template render errors

* Better error message

* Add custom test lock config for code format

* Add type hints from upstream

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-06-10 16:54:17 +02:00
epenet c896458fcf
Fix namespace-import pylint warning in components (#119299) 2024-06-10 15:55:08 +02:00
epenet c7cc465e5c
Add return type hints in tests (k-z) (#118942) 2024-06-06 10:11:29 +02:00
epenet 166c588cac
Add LogCaptureFixture type hints in tests (#118372) 2024-05-29 14:10:00 +02:00