| 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)] -> 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 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 # | |
| MonadError MockError Mock Source # | |
Defined in Lifx.Lan.Mock.Terminal | |
| MonadReader [Device] Mock Source # | |
| MonadState (Map Device MockState) Mock Source # | |
| type MonadLifxError Mock Source # | |
Defined in Lifx.Lan.Mock.Terminal | |
Instances
| Show MockError Source # | |
| MonadError MockError 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.
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 (Maybe StateService) (Maybe StateHostFirmware) (Maybe StateVersion) |