Commit Graph

19 Commits (c6ab2c5d0a32187a81e60435ef3dcb849252edda)

Author SHA1 Message Date
Shulyaka 872140123d
Add humidifier support to prometheus (#37112)
* Add humidifier support to promethease

* add humidifier dependency

* handle dependencies

* wrong place

* applied suggestions from code review

* fix typo

* Revert "wrong place"

This reverts commit 58e509d767.

* Revert "handle dependencies"

This reverts commit 74bd523e08.

* Revert "add humidifier dependency"

This reverts commit 8840b378e5.
2020-07-08 20:42:45 -04:00
craiggenner 212660330f
Cope with attribute errors being converted (#36911) 2020-06-19 05:36:56 +02:00
Anton Tolchanov d14112748c
Add a Prometheus metric for HVAC action (#31945) 2020-06-03 11:53:21 +02:00
Martin Weinelt acfd907c50
Expose switch attributes in Prometheus component (#35216) 2020-06-02 22:47:49 +02:00
Nacho Barrientos a55c6c5f47
Make prometheus light state report robust (#36134) 2020-05-27 09:59:40 +02:00
springstan f1a0ca7cd3
Add and use percentage constant (#32094)
* Add and use percentage constant

* Fix pylint error and broken test
2020-02-28 11:46:48 -08:00
Christian Clauss df7d2b3aeb
Fix typos found by codespell (#31243)
* Fix typos found by codespell

* Fix typos found by codespell

* codespell: Furture  ==> Future

* Update test_config_flow.py

* Update __init__.py

* Spellcheck: successfull  ==> successful

* Codespell: unsuccesful  ==> unsuccessful

* Codespell: cant  ==> can't

* Codespell: firware ==> firmware

* Codespell: mimick  ==> mimic
2020-01-31 08:33:00 -08:00
Joe Gross 3b4c3e6e17 Fix prometheus component to fully sanitize Unicode characters (#31037)
* Fix prometheus component to fully santize Unicode characters.

Sanitization used isdigit() to match numerics but that also matches 
Unicode "digit" characters that require special handling, like 
superscripts. Failures would look like this:

ValueError: Invalid metric name: sensor_unit_u0x23_per_m³

Changed sanitize to use string.digits, which matches only ascii digits, 
and added test.

See 
https://stackoverflow.com/questions/44891070/whats-the-difference-between-str-isdigit-isnumeric-and-isdecimal-in-python 
for discussion.

https://docs.python.org/3/library/stdtypes.html#str.isdigit

https://docs.python.org/3.7/library/string.html#string.digits

* fix formatting to comply with black
2020-01-22 01:03:42 +01:00
springstan 4f8200d15a Ignore state of climate entities in prometheus (#29346) 2019-12-03 12:54:25 -08:00
Diefferson Koderer Môro 2d36e9c08e Move imports in prometheus component (#28086) 2019-10-21 22:35:43 -07:00
Andrew Rowson 770eeaf82f Encode prometheus metric names per the prom spec (#26639)
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.
2019-09-19 12:51:49 +02:00
Per Osbäck e9705af055 Prometheus metrics naming based on device_class and unit_of_measurement (#24103)
* - 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
2019-08-10 14:35:04 +02:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
cgtobi 2c07bfb9e0 Remove dependencies and requirements (#23024)
* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit fe7171b4cd.

* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit 391355ee2c.

* Remove dependencies and requirements

* Fix flake8 complaints

* Fix more flake8 complaints

* Revert non-component removals
2019-04-12 10:13:30 -07:00
Robbie Trencheny e9cd9f88be
Fix Prometheus casting issues (#22282)
## Description:

Fix Prometheus casting issues

**Related issue (if applicable):** fixes #8659.
## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-22 13:16:17 -07:00
Richard Mitchell c595cf016f Support the person component in Prometheus (#21363) 2019-02-23 18:13:27 +01:00
Joakim Plate c5de32e7b1 Climate const.py move (#20945)
* Move constants to const.py

* Import from const instead of climate
2019-02-14 20:34:43 +01:00
Fabian Affolter 161c368c9d Update file header (#21054)
* Update file header

* Update __init__.py
2019-02-13 20:35:12 -08:00
Paulus Schoutsen b8cc547fa3
Move components to folders (#20774)
* Move all components into folders

* Move component tests into folders

* Fix init moving

* Move tests

* Lint

* Update coverage

* Fix service descriptions

* Update CODEOWNERS
2019-02-05 19:31:15 -08:00