10 Commits

Author SHA1 Message Date
e45bfc9936 Update HACS details 2021-12-18 14:16:52 +00:00
130a79da16 Improve error handling 2021-12-18 14:16:40 +00:00
9355c0917a Use HA defintions rather than our own 2021-11-14 16:47:20 +00:00
3e24460b24 More error handling for failed queries and unavailable Prometheus 2021-11-14 16:44:44 +00:00
1ad0c03cdd Remove unneeded imports 2021-11-14 16:36:45 +00:00
FriendlyNGeeks
962ab5e3fa device_class added 2021-11-11 10:44:40 -05:00
Grégoire Seux
85d4acb229 Migrate to SensorEntity base class
Goal is to be usable as a source of energy in the energy dashboard.
Starting with HA 2021.9 (still in beta), sensors will be have long term
stats and be usable in energy dashboard.
It also gives a better integration with base classes of home assistant
and decrease code in this custom component.

Change-Id: Ide1967ac181c0cf7f093cff539aae2b1cdccd9b4
2021-08-29 21:14:40 +02:00
Grégoire Seux
f40cf1bfec Support unique_id
Support is a bit fragile since we don't really have a serial number to
base on. However we have a reasonnable default (source prometheus +
expression) and a way for user to specify id easily if they to change
the prometheus query.
2021-08-29 21:14:40 +02:00
Grégoire Seux
4fbe9c5660 Support state class propoerty for sensor
Fix lfasci/homeassistant-prometheus-query#5

Goal is to make a first pass to allow to be exposed in the energy
dashboard.
This requires usage of HA version 2021.9 (which is beta at time of
writing) if we want to allow total_increase state_class
2021-08-29 21:14:40 +02:00
William Johansson
0c73f9932f Create custom_components root directory 2021-07-07 18:37:48 +02:00