PicoW_HomeAssistant_Starter icon indicating copy to clipboard operation
PicoW_HomeAssistant_Starter copied to clipboard

[FEATURE] Enable Last Will and Testament

Open JacobChrist opened this issue 1 year ago • 2 comments

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)

JacobChrist avatar Nov 05 '23 15:11 JacobChrist

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.

daniloc avatar Nov 05 '23 20:11 daniloc

No shit and done.

JacobChrist avatar Nov 05 '23 20:11 JacobChrist