Earl Standard Library implements components that are thought of as being useful for implementing rules in IoT scenarios. This document describes all components in detail. The code that implements components is in stdlib.py. For components that are already implemented externally, info can be found at the bottom.
Conventions
Components are divided into sections according to their namespace
Description of each component starts with listing its inputs and outputs
Input names are prefixed with“req”if they are required and“opt”if they are optional
Both input and output names are followed by type in parentheses, e.g.“(urn)”
Types might be specified informally, e.g.“(comparable)”
Input/Output(port) description follows the type
If no inputs or outputs are available, this will be indicated as None
Components in general let Earl save the values on inputs for later even when“called”. However, some of them instruct Earl to erase certain inputs. These inputs’ types are prefixed with“◐”.
Variable number of inputs will be indicated with“…”
Messaging
Notify - allthingstalk.messaging.notify
Inputs
reqrecipient(urn): The message recipient, either a user or a ground
req message(string): The message that will be sent
opt sendPush(◐truthy): Send push notification
optsendWeb(◐truthy): Send web notification
optsendEmail(◐truthy): Send email
Outputs
None
Notify is used for sending messages to a single user or all users in a ground. It can be used to send push notifications, web notifications and emails.
Conventions
Messaging
Notify - allthingstalk.messaging.notify
# Send email when data is received on an asset
device = allthingstalk.device.ExampleId1
notify = allthingstalk.messaging.notify
urn:allthingstalk:user:ExampleId2 -> notify.recipient
"Your device just sent something!" -> notify.message
device.asset -> notify.sendEmail
Math
Compare - allthingstalk.math.compare