| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
HomeAssistant.Client
Description
Client library for the Home Assistant API.
Synopsis
- type API = "api" :> Endpoints
- type HA = ClientM
- type JSONOptions (prefix :: Symbol) = '[OmitNothingFields, FieldLabelModifier '[StripPrefix prefix, CamelToSnake]]
- data StateChange
- status :: HA Value
- config :: HA Config
- services :: HA [ServiceDomain]
- callService :: Text -> Text -> Maybe Value -> HA Value
- mkHomeAssistantEnv :: ByteString -> Manager -> BaseUrl -> ClientEnv
- module Servant.Client
Documentation
type JSONOptions (prefix :: Symbol) = '[OmitNothingFields, FieldLabelModifier '[StripPrefix prefix, CamelToSnake]] Source #
The custom JSON encoding/decoding options for HA types.
HA does not like fields that are set to null - they must be omitted.
data StateChange Source #
Represents information about the state of an entity.
Instances
services :: HA [ServiceDomain] Source #
callService :: Text -> Text -> Maybe Value -> HA Value Source #
callService domain service body calls service in domain with an
optional body. The result depends on the service.
mkHomeAssistantEnv :: ByteString -> Manager -> BaseUrl -> ClientEnv Source #
module Servant.Client