You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would be nice if the HABaseDeviceType class had a pointer to a struct (or class) that could be used to hold arbitrary data per users need. This would allow adding information that could be retrieved by a generic handler. This would allow you to do things like this:
classZoneData {
public:uint8_t led_pin;
uint8_t ssr_pin;
};
voidHAIntegration::switchHandler(bool state, HASwitch* sender) {
digitalWrite(((ZoneData)sender->data).led_pin, (state ? HIGH : LOW));
digitalWrite(((ZoneData)sender->data).ssr_pin, (state ? HIGH : LOW));
sender->setState(state); // report state back to Home Assistant
}
The text was updated successfully, but these errors were encountered:
I agree, I'm only now realizing that your project is dependent on that library. I've never used VS Code for embedded development so I'm learning a few things right now.
I would be nice if the HABaseDeviceType class had a pointer to a struct (or class) that could be used to hold arbitrary data per users need. This would allow adding information that could be retrieved by a generic handler. This would allow you to do things like this:
The text was updated successfully, but these errors were encountered: