* Record state.last_reported
* Include last_reported in parts of the history API
* Use a bulk update
* fix refactoring error
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
* Use `mock_platform` for cover entity component tests instead of `hass.components`
* Remove setup fixture and use helper function
* Remove is_on from MockCover
* Run ruff
* Do not override state in `MockCover` in cover tests
* Remove is_on from MockCover
Avoid delaying automation/script startup to check if the blueprint folder exists
automations and script both populate sample blueprints if none exist
The check to see if the blueprint folder exists always had to create
an executor job which would delay startup a bit if the executor was
busy. Since we do not need the sample blueprints to be populated
until the start event, we can run this in a task.
* Refactor Integration sensor.
* Use local simple function to verify the State is numeric.
* Merge two methods to one.
* Method renaming: _handle_state_change
* Move async_write_ha_state to the caller.
* Add comment on why attr_icon is set to None
* Remove possible None type of State in validation methods.
* Use a dict to map method name to method class.
* Explain derived unit after integration.
* Renaming to _multiply_unit_with_time and elaborate in docstring.
* Set integral unit_of_measurement explicitly to None if source unit_of_measurement is None
* One function for unit of measurement related steps.
* Improve docstring of _multiply_unit_with_time
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Apply f-string suggestions from code review
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Be more clear in comment about removing the sensors icon default.
* Apply suggestions from code review
Co-authored-by: Diogo Gomes <diogogomes@gmail.com>
* Update homeassistant/components/integration/sensor.py
* Update homeassistant/components/integration/sensor.py
* Update homeassistant/components/integration/sensor.py
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Diogo Gomes <diogogomes@gmail.com>
* add more timestamp sensors
* more generic definition for future sensors
* add entity descriptor
* use enable property to prevent sensors from getting added
* set legacy attribute flag for first sensor
* remove departure from extra attributes
* remove breaking changes again and keep for next pr
* fix multiline statements
* outsource the multiline ifs into function
---------
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>