add variable system + fix bugs here and there.

This commit is contained in:
2023-01-13 01:19:34 +01:00
parent 88036cfcae
commit 842f96d8e3
22 changed files with 368 additions and 43 deletions
+6
View File
@@ -54,6 +54,10 @@ func New(addr string) (lucifer3.Service, error) {
bus.RunCommand(*input.ForgetDevice)
case input.SearchDevices != nil:
bus.RunCommand(*input.SearchDevices)
case input.AddAlias != nil:
bus.RunCommand(*input.AddAlias)
case input.RemoveAlias != nil:
bus.RunCommand(*input.RemoveAlias)
default:
return c.String(400, "No supported command found in input")
}
@@ -104,6 +108,8 @@ func (s *service) HandleEvent(bus *lucifer3.EventBus, event lucifer3.Event) {
type commandInput struct {
Assign *assignInput `json:"assign,omitempty"`
AddAlias *commands.AddAlias `json:"addAlias,omitempty"`
RemoveAlias *commands.RemoveAlias `json:"removeAlias,omitempty"`
PairDevice *commands.PairDevice `json:"pairDevice,omitempty"`
SearchDevices *commands.SearchDevices `json:"searchDevices,omitempty"`
ForgetDevice *commands.ForgetDevice `json:"forgetDevice,omitempty"`