Referencing issue #26418.
Prometheus metric names can only contain chars a-zA-Z0-9, : and _
(https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
HA currently generates invalid prometheus names, e.g. if the unit for a
sensor is a non-ASCII character containing ° or μ. To resolve, we need
to sanitize the name before creating, replacing non-valid characters
with a valid representation. In this case, I've used
"u{unicode-hex-code}".
Also updated the test case to make sure that the ° case is handled.
* Change datetime.now() to dt_util.now() in cases where the functionality should stay the same
These changes should not affect the functionality, rather cleanup our codebase.
In general we would like integrations to not to use datetime.now() unless there's a very good
reason for it, rather use our own dt_util.now() which makes the code aware of our current time
zone.
* Use datetime.utcnow() for season sensor to get offset-naive utc time
* Revert "Use datetime.utcnow() for season sensor to get offset-naive utc time"
This reverts commit 5f36463d9c7d52f8e11ffcec7e57dfbc7b21bdd1.
* BOM sensor last_updated should be UTC as well
* Run black
* Remove unused last_partition_update variable
* Improve binary sensor tests
* Fix sensor tests
* Improve readability of binary sensor
* Fix climate tests
Fix sensor platform not loading climate devices as sensors
* Add test to verify adding new sensor after start up
* Fix typo in translations
* Work on bug #26619
* readd the homeassistant.start event
* Remove the callback
* Added the executor_job for _test_connection
* Update test_config_flow.py
* Composite entities require multiple value types to be present in
child values to function. Any of those value types should trigger an
entity update if updated.
* Always write platform v names as sets.
* Run black.
* velux KLF200 device did not disconnect properly when rebooting the hass device.
disconnect is now being called on the 'EVENT_HOMEASSISTANT_STOP' event
* removed comment
* removed comment
* trigger bot
* trigger bot
* trigger bot
* logging casing fixed. code moved from init.
* logger level debug
logger level moved from info to debug
only config[DOMAIN] exposed to module
imports moved to top
* DOMAIN part of config passed to module.
* removed trailing whitespaces etc.
* black --fast changes
* added missing docstring
* D400 First line should end with a period
* black formatting
Allow turning a light on instantly, with no transition time.
This is actually required for IKEA lights to be able to set brightness
and color temp in a single call.
* Improve configure service tests
* Add refresh device service test
* Add tests for setup and unload services
* Remove refresh device test from test_init
* Extra verification of deconz services existance in hass.data
* Emulate color temperature for non-ct lights in light groups
* fix tests
* Address review comments
* Fix black formatting
* Fix for pylint
* Address comments
* Fix black formatting
* Address comments
* Initial implementation of ZCL color loop effect
* Fix linter complaints
* Use const for action
* Reformat with Black
* Cleanup after review.
* Handle effect being None