Rename switch to switchService to avoid AFRP name conflict
This commit is contained in:
@@ -27,7 +27,7 @@ module HomeAssistant.Controller
|
||||
, debug
|
||||
, traceEvent
|
||||
, traceValue
|
||||
, switch
|
||||
, switchService
|
||||
, Target(..)
|
||||
, lightBrightnessEvent
|
||||
, lightTemperatureEvent
|
||||
@@ -199,9 +199,8 @@ light targets Off = Service
|
||||
, serviceTarget=targets
|
||||
}
|
||||
|
||||
-- Name conflict with AFRP
|
||||
switch :: [Target] -> Bool -> Service
|
||||
switch targets b = Service
|
||||
switchService :: [Target] -> Bool -> Service
|
||||
switchService targets b = Service
|
||||
{ serviceDomain="switch"
|
||||
, serviceName= bool "turn_off" "turn_on" b
|
||||
, serviceData=Nothing
|
||||
|
||||
@@ -132,8 +132,8 @@ bedroomDrawerController :: HASS (Event Value) ()
|
||||
bedroomDrawerController = proc x -> do
|
||||
st <- drawer >>> traceEvent -< x
|
||||
case st of
|
||||
Event Open -> callService (switch [entity] True) -< ()
|
||||
Event Closed -> callService (switch [entity] False) -< ()
|
||||
Event Open -> callService (switchService [entity] True) -< ()
|
||||
Event Closed -> callService (switchService [entity] False) -< ()
|
||||
_ -> returnA -< ()
|
||||
where
|
||||
entity = EntityId "switch.bedroom_drawer_light_masse"
|
||||
|
||||
@@ -74,7 +74,7 @@ dinnerTableController = proc x -> do
|
||||
sleep -< True
|
||||
_ -> returnA -< ()
|
||||
where
|
||||
sleep = callServiceDyn (switch [EntityId "switch.adaptive_lighting_ruokapoydan_valot_sleep_mode"])
|
||||
sleep = callServiceDyn (switchService [EntityId "switch.adaptive_lighting_ruokapoydan_valot_sleep_mode"])
|
||||
|
||||
kitchenMotionController :: HASS (Event Value) ()
|
||||
kitchenMotionController = kitchenCeilingController <> dinnerTableController
|
||||
|
||||
Reference in New Issue
Block a user