Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Rather than interacting with any bulbs, simulate interactions by printing to a terminal.
Synopsis
- data Mock a
- data MockError
- runMock :: [(Device, Text)] -> Mock a -> IO (Either MockError a)
- runMockFull :: [(Device, MockState)] -> Mock a -> IO (Either MockError a)
- data MockState = MockState LightState (Maybe StateService) (Maybe StateHostFirmware) (Maybe StateVersion)
Documentation
Instances
MonadIO Mock Source # | |
Defined in Lifx.Lan.Mock.Terminal | |
Applicative Mock Source # | |
Functor Mock Source # | |
Monad Mock Source # | |
MonadLifx Mock Source # | |
Defined in Lifx.Lan.Mock.Terminal type MonadLifxError Mock Source # liftProductLookupError :: ProductLookupError -> MonadLifxError Mock Source # lifxThrow :: MonadLifxError Mock -> Mock a Source # sendMessage :: Device -> Message r -> Mock r Source # broadcastMessage :: Message r -> Mock [(Device, r)] Source # | |
type MonadLifxError Mock Source # | |
Defined in Lifx.Lan.Mock.Terminal |
runMock :: [(Device, Text)] -> Mock a -> IO (Either MockError a) Source #
Run a LIFX action by mocking effects in a terminal.
Note that sending some messages (e.g. GetVersion
) will throw exceptions, since the necessary state isn't specified.
See runMockFull
for more control.