templatesensor icon indicating copy to clipboard operation
templatesensor copied to clipboard

Support for device_class and should_poll

Open notabene00 opened this issue 3 years ago • 7 comments

Now you can select device_class and should_poll for sensor while creating

Removed unused imports Code formatted with isort and black 0.2.0 version according to SV

DEVICE_CLASSES taken from device classes constants supported by sensors so they'll be actual if list will change

should_poll default for sensors that haven't such property is True so that is taken into account too in the edit window it is True for previously created (they hasn't should_poll key in the config data) sensors and it's still True for these sensors in their configuration as the fallback for missing should_poll key is True there too

notabene00 avatar Jul 08 '21 11:07 notabene00

Снимок экрана 2021-07-08 в 14 22 31 Снимок экрана 2021-07-08 в 14 23 25

notabene00 avatar Jul 08 '21 11:07 notabene00

Снимок экрана 2021-07-08 в 14 17 53

notabene00 avatar Jul 08 '21 11:07 notabene00

Снимок экрана 2021-07-08 в 14 56 19 Снимок экрана 2021-07-08 в 14 57 11 There's no need to keep updating every 30 seconds in such cases

notabene00 avatar Jul 08 '21 12:07 notabene00

Снимок экрана 2021-07-09 в 15 20 56

https://user-images.githubusercontent.com/9576189/125082592-15e3c480-e0d0-11eb-9030-924a62ccb41b.mov

Updating in real time Work in progress :)

notabene00 avatar Jul 09 '21 13:07 notabene00

@ludeeus Is there a chance to get it merged?

rufik avatar Nov 15 '21 09:11 rufik

No, not really, you should not use this integration anymore, you should use YAML. This integration was created at a time where you had to restart Home Assistant for template changes. That is no longer the case, there is a reload button/service to reload template entities now.

ludeeus avatar Feb 20 '22 20:02 ludeeus

While I applaud the effort, this integration was always a hack, and it should not be used anymore by anyone.

The core https://www.home-assistant.io/integrations/template/ integration, supports reloads and these 2 fields and much more.

ludeeus avatar Feb 20 '22 20:02 ludeeus