This commit is contained in:
[Valentino Heman Budiarto]
2026-06-05 20:46:51 +07:00
parent 679461d3a3
commit 89c68f340f
2 changed files with 24 additions and 23 deletions
+7 -5
View File
@@ -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"
}
}