from django.dispatch import Signal

# Sent when a device sends data readings
# sender: DeviceType class, device: instance, readings: dict, message: raw record
device_data_received = Signal()

# Sent when a device status changes
# sender: DeviceType class, device: instance, old_status: str, new_status: str
device_status_changed = Signal()

# Sent when a device connects
# sender: DeviceType class, device: instance
device_connected = Signal()

# Sent when a device disconnects (or heartbeat timeout)
# sender: DeviceType class, device: instance
device_disconnected = Signal()

# Sent when a command is published to a device
# sender: DeviceType class, device: instance, command: str, payload: dict
device_command_sent = Signal()

# Sent when a new device is provisioned with credentials
# sender: DeviceType class, device: instance, credentials: dict
device_provisioned = Signal()
