templatesensor
templatesensor copied to clipboard
Support for device_class and should_poll
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






https://user-images.githubusercontent.com/9576189/125082592-15e3c480-e0d0-11eb-9030-924a62ccb41b.mov
Updating in real time Work in progress :)
@ludeeus Is there a chance to get it merged?
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.
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.