Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Lifx.Lan.Mock.Terminal
Description
Rather than interacting with any bulbs, simulate interactions by printing to a terminal.
Synopsis
- data Mock a
- data MockError
- runMock :: [(Device, (Text, Text))] -> Mock a -> IO (Either MockError a)
- runMockFull :: [(Device, MockState)] -> Mock a -> IO (Either MockError a)
- data MockState = MockState LightState StateGroup (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 Associated Types type MonadLifxError Mock Source # Methods 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, 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.
runMockFull :: [(Device, MockState)] -> Mock a -> IO (Either MockError a) Source #
More general version of runMock
, which allows specifying extra information about devices.
Constructors
MockState LightState StateGroup (Maybe StateService) (Maybe StateHostFirmware) (Maybe StateVersion) |