PicoW_HomeAssistant_Starter
PicoW_HomeAssistant_Starter copied to clipboard
[FEATURE] Enable Last Will and Testament
Enabling the LWT (Last Will and Testament) feature requires adding three lines of code and add the very cool functionality of giving HA the ability to detect if the device looses power.
device.enableSharedAvailability(); // [OPTIONAL] Enables the ability to set the on/off line status of the device
device.setAvailability(true); // Set the device to on-line
device.enableLastWill(); // [OPTIONAL] Allows HA to detect when the device losses power (and thus disable the controls in the HA UI)
No shit? Great find. Probably makes any IoT device better behaved and match people's expectations. If you wanted to add this to a potential PR I'd be into it.
No shit and done.