* Refactor keyed event trackers to avoid refactoring risk
Follow to https://github.com/home-assistant/core/pull/110978#discussion_r1496771106
I had to do some type ignores because of the EventType vs Event
which is hopefully not going to be needed after the next mypy
* delete constants only used one in other const
* no field
* fixes
* less refactoring later
* less refactoring later
* keep const
* Make adding entities in storage collection a normal function
Nothing is awaited when adding
* cleanup
* cleanup
* cleanup
* cleanup
* reduce
* reduce
* reduce
* reduce
* tweak
These functions created tasks to run small validators, and the cost of
creating all the tasks was more expensive than running the validators
themselves. Since the code is unlikely to suspend its more efficient to
await them in series.
* YAML loader performance improvements
- Cache the name of the loader since we call it multiple
times for every line
- Add a fast path for scalar tags since they are the
most common
* Update homeassistant/util/yaml/loader.py
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
* remove unreachable code
---------
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
* Add counter entities to the ZHA coordinator device
* rework to prepare for non coordinator device counters
* counter entity test
* update log lines
* disable by default
panel_custom never suspends so we can avoid the overhead of
creating and scheduling tasks
e398accc3e/homeassistant/components/panel_custom/__init__.py (L74)
panel_custom.async_register_panel could be converted to a normal function but it
would be a breaking change
* Bump library
* Update code to the new library version
* Improve diagnostics
* Fix tests
---------
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
* add HeatingProgram type
* use HeatingProgram type
* add heatpump number sensors
* use HeatingProgram type
* Update strings.json
* rename HeatingProgram to Program
* remove commented code
* rename heating program type
* simplify
* Apply suggestions from code review
* Update strings.json
* Update const.py
* fix
* add heating program type
* correct imports
* Revert "fix"
This reverts commit 857dda59da.
* Apply suggestions from code review
* Update strings.json
* aemet: disable legacy options
This enables proper timezone handling:
- Atlantic/Canary for the Canary Islands.
- Europe/Madrid for the Iberian Peninsula.
Also provides daily data for the current day after AEMET stops providing the
full day interval, which is normally after midday (12:00).
This is a breaking change because with the previous behaviour the daily data
for the current day wasn't available after midday and now it will be.
What the integration library does to workaround this is to fallback to the
12-24 interval data if the the 00-24 is no longer provided by the API.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* Fix AEMET tests with v0.4.8
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---------
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* Add switch platform for husqvarna_automower
* Use RestrictedReasons const
* Typing
* Add snapshot testing
* Invert switch
* Test sucessfull servie calls
* Assert client mock calls
* Use getattr
* Update snapshot
* Add available property
* Add a new base class for control entities
* Make switch unavailabe if mower in error state
* Sort platforms
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>