sebr / bhyve-home-assistant

Orbit BHyve custom component for Home Assistant
MIT License
252 stars 42 forks source link

Add "device_class: timestamp" to relevant sensors #139

Closed wtadler closed 2 years ago

wtadler commented 2 years ago

This change adds the device class attribute device_class: timestamp to the "Zone Watering History" sensor indicating the most recent watering, and the "Next Scheduled Watering" sensor (created when running bhyve_next_watering.py). This makes it so that they appear in the dashboard as relative times (i.e., "Tomorrow") rather than as the full datetime value.

I've also eliminated the DEVICECLASS* constants, which were deprecated in 2021.12 in favor of SensorDeviceClass.

This is working for me, but it should be tested by someone whose setup includes battery and temperature entities, which mine does not.