.
This commit is contained in:
@@ -153,17 +153,19 @@ func ControlHardware(c *gin.Context) {
|
||||
haToken := os.Getenv("HA_TOKEN")
|
||||
var entityID string
|
||||
|
||||
switch req.Device {
|
||||
switch req.Device {
|
||||
case "ac":
|
||||
if req.Action == "on" {
|
||||
switch req.Action {
|
||||
case "on":
|
||||
entityID = "scene.ac_d101_on"
|
||||
} else {
|
||||
default:
|
||||
entityID = "scene.ac_d101_off"
|
||||
}
|
||||
case "projector":
|
||||
if req.Action == "on" {
|
||||
switch req.Action {
|
||||
case "on":
|
||||
entityID = "scene.projector_d101_on"
|
||||
} else {
|
||||
case "off":
|
||||
entityID = "scene.projector_d101_off"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user