* Adds a loader to enable jinja imports.
* Switch to in-memory
* Move loading custom_jinja off of the event loop
* Raise TemplateNotFound if template doesn't exist
* Fix docstring
* Adds a service to reload custom jinja
* Remove IO from test setup
* Improve coverage and small refactor
* Incorporate feedback and use .jinja extension
* Check the loaded sources in test.
* Incorporate PR feedback.
* Update homeassistant/helpers/template.py
Co-authored-by: Erik Montnemery <erik@montnemery.com>
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Allow customizing sensor precision
* Don't convert integer strings to floats
* Tweak converting sensor state to number
* Drop default rounding to 2 decimals
* Adjust test
* Tweak rounding, improve test coverage
* Don't convert to a number if not necessary
* Raise if native_precision is set and state is not numeric
* Address review comments
* Address comments, simplify
* Don't call property twice
* Make exception more helpful
* Add suggested_unit_of_measurement attribute to sensors
* Lazy calculation of initial entity options
* Add type alias for entity options
* Small tweak
* Add tests
* Store suggested_unit_of_measurement in its own option key
* Adapt to renaming of IMPERIAL_SYSTEM
* Fix rebase mistakes
* Apply suggestions from code review
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* Add temperature unit conversion to number
* Remove type enforcements
* Lint
* Fix legacy unit_of_measurement
* Address review comments
* Fix unit_of_measurement, improve test coverage
* Add native unit types for weather entities
* Update weatherentity and change precision in climacell test
* Move weather test to demo tests
* Add weather test for temperature conversion
* Add more unit conversion tests
* Remove extra native_ methods
* Remove extra properties and save precision change for another PR
* Remove visibility_unit from metoffice component
The vibility values given by metoffice are formatted into strings,
which means they can't automatically be converted.
* Improve docstrings and convert pressures in forecast
* Add precipitation and wind speed units
* Clean up tests
* Round converted weather values
* Round weather values to 2 decimal places
* Move number of rounding decimal places to constant
* Docstring and styles
* Change existing toggle to add new function
* Fixed using old property method to using actual protected variable.
* Adding service tests to new cover toggle function
* Working on comments from Pull Request 59233
* Adjust existing tests to fit new fake cover setup
* MockCover is calling state method of MockEntity but should call it from CoverEntity
* using different entity to get back test coverage