package plugin import "context" // IoTProvider is implemented by plugins that manage IoT devices. // Only one IoTProvider can be active at a time. type IoTProvider interface { Plugin // ListDevices returns all managed devices. ListDevices(ctx context.Context) ([]Device, error) // GetDevice returns a single device by ID. GetDevice(ctx context.Context, id string) (*Device, error) // SetDevice sets a property on a device (e.g., brightness=80). SetDevice(ctx context.Context, id, field string, value any) error // ToggleDevice toggles a device's power state. ToggleDevice(ctx context.Context, id string) error // SubscribeChanges returns a channel that emits device state changes. // The channel is closed when the context is cancelled. SubscribeChanges(ctx context.Context) (<-chan DeviceEvent, error) }