Skip to content

Commit

Permalink
Add API for setting device error (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
sikmir authored Jan 15, 2025
1 parent 54c8b28 commit 7a569dd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions devices.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ type LocalDevice interface {

// Removes control by id
RemoveControl(id string) func() error

SetError(err DeviceError) FuncError
}

// ExternalDevice is a user representation of external MQTT device
Expand All @@ -93,13 +95,18 @@ type ExternalDevice interface {
RemoveControl(id string)
}

type DeviceError interface {
Error() string
}

// LocalDeviceArgs is a handy way to pass local device attributes
type LocalDeviceArgs interface {
SetVirtual(v bool) LocalDeviceArgs
SetDoLoadPrevious(v bool) LocalDeviceArgs
SetId(v string) LocalDeviceArgs
SetTitle(v Title) LocalDeviceArgs
SetDriver(v DeviceDriver) LocalDeviceArgs
SetError(v DeviceError) LocalDeviceArgs
GetID() *string
GetTitle() *Title
GetDriver() DeviceDriver
Expand Down

0 comments on commit 7a569dd

Please sign in to comment.