more scene stuff. There's still no command and API to push scenes and unassign (aside from setting a temporary scene and waiting it out).
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-10-05 20:11:53 +02:00
parent 07173e4e56
commit 1b7e495a59
14 changed files with 416 additions and 9 deletions
+2 -4
View File
@@ -56,7 +56,7 @@ func (s *Scene) RoleIndex(device *Device) int {
type SceneEffect string
const (
SEStatic SceneEffect = "Plain"
SEStatic SceneEffect = "Static"
SERandom SceneEffect = "Random"
SEGradient SceneEffect = "Gradient"
SEWalkingGradient SceneEffect = "WalkingGradient"
@@ -120,7 +120,7 @@ func (r *SceneRole) Validate() error {
}
switch r.Effect {
case SEStatic, SERandom, SEGradient, SETransition:
case SEStatic, SERandom, SEGradient, SEWalkingGradient, SETransition:
default:
return ErrSceneRoleUnknownEffect
}
@@ -201,8 +201,6 @@ func (r *SceneRole) State(fac float64) NewDeviceState {
return r.States[0]
}
if r.Interpolate {
if len(r.States) == 2 {
return r.States[0].Interpolate(r.States[1], fac)