mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-06 05:15:15 -06:00
refactor all automation types to take a list
This commit is contained in:
@@ -121,9 +121,6 @@ func (sb scheduleBuilderEnd) EnabledWhen(entityId, state string, runOnNetworkErr
|
||||
if entityId == "" {
|
||||
panic(fmt.Sprintf("entityId is empty in EnabledWhen entityId='%s' state='%s'", entityId, state))
|
||||
}
|
||||
if len(sb.schedule.disabledEntities) != 0 {
|
||||
panic(fmt.Sprintf("You can't use EnabledWhen and DisabledWhen together. Error occurred while setting EnabledWhen on a schedule with params entityId=%s state=%s runOnNetworkError=%t", entityId, state, runOnNetworkError))
|
||||
}
|
||||
i := internal.EnabledDisabledInfo{
|
||||
Entity: entityId,
|
||||
State: state,
|
||||
@@ -141,9 +138,6 @@ func (sb scheduleBuilderEnd) DisabledWhen(entityId, state string, runOnNetworkEr
|
||||
if entityId == "" {
|
||||
panic(fmt.Sprintf("entityId is empty in EnabledWhen entityId='%s' state='%s'", entityId, state))
|
||||
}
|
||||
if len(sb.schedule.enabledEntities) != 0 {
|
||||
panic(fmt.Sprintf("You can't use EnabledWhen and DisabledWhen together. Error occurred while setting DisabledWhen on a schedule with params entityId=%s state=%s runOnNetworkError=%t", entityId, state, runOnNetworkError))
|
||||
}
|
||||
i := internal.EnabledDisabledInfo{
|
||||
Entity: entityId,
|
||||
State: state,
|
||||
|
||||
Reference in New Issue
Block a user