* Fix duplicate metrics in prometheus
* Fix duplicate prometheus metrics for entities with multiple labelsets
- Move friendly_name detection to state_changed event
- Add additional test case
* Add review suggestions for prometheus friendly name update
* Remove commented out code in prometheus
* Update prometheus tests for deleted metrics
* Add review suggestions for prometheus
- Remove unnecessary firendly_name check in handle_entity_registry_updated
- Add assert in test
* Removed prometheus from .coveragerc
* Update prometheus tests with handler categories
* Updated prometheus metrics to use the current registry
- don't use the registry created on import (needed for tests)
* Reset the prometheus CollectorRegistry before every test
* Update prometheus metrics generation
- Use latest registry when generating a response
* Add default collectors when resetting the registry
* Move entities to the specific prometheus test case
* Refactor body generation for prometheus tests
* Add test case for sensors without unit after rebase
* Fix prometheus tests
- Wait for events in prometheus tests
- Add workaround for demo platform dependecy conversation (aiohttp frozen router)
* Added prometheus tests for attribute metrics
* Added prometheus tests for binary_sensor
* Add prometheus test for input_boolean
* Add prometheus test for lights
* Add prometheus test for lock
* Add prometheus test for sensor fahrenheit conversion
* Fix prometheus test for input_number
* Added GLOB capability to entityfilter and every place that uses it. All existing tests are passing
* added tests for components affected by glob change
* fixed flake8 error
* mocking the correct listener
* mocking correct bus method in azure test
* tests passing in 3.7 and 3.8
* fixed formatting issue from rebase/conflict
* Checking against glob patterns in more performant way
* perf improvments and reverted unnecessarily adjusted tests
* added new benchmark test around filters
* no longer using get with default in entityfilter
* changed filter name and removed logbook from filter benchmark
* simplified benchmark tests from feedback
* fixed apache tests and returned include exclude schemas to normal
* fixed azure event hub tests to properly go through component logic
* fixed azure test and clean up for other tests
* renaming test files to match standard
* merged mqtt statestream test changes with base
* removed dependency on recorder filter schema from history
* fixed recorder tests after merge and a bunch of lint errors
* Add and use speed constants
* Add and use meter based volume and area constants
* Add and use more mass unit constants
* Add and use concentration unit constants
* Add and use watts per square meter constant
* Use more time constants
* Use more data constants
* Add config entry and device support to Demo
* Some more devices
* Fix tests using demo
* Review comments
* Update config_flow.py
* Revert
* Disable pylint
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 how we extract the metrics for sensors
- Add component filtering as seen in influxdb
- Add metric override as seen in influxdb
- Add more unit tests with actual device data
* Extract sensor metric logic to separate handlers
* Update prometheus dependency
* Format using black
* Format using black
* Fix flake8
* Move sensor metric handler list to init
* Use f strings instead of .format