class

ShellyplugExporter::PlugClient

Inherits Reference < Object

Handles HTTP communication with a single Shelly plug device.

Constants

CONNECT_TIMEOUT = 4.seconds
READ_TIMEOUT = 4.seconds
SHELLY_ENDPOINT = "/shelly"

Constructors

new(config : PlugConfig)
Source

Instance methods

detect_generation

Detects the plug generation by probing the /shelly endpoint. Gen2 devices include a "gen" field in their response. Returns the detected PlugGeneration, defaulting to Gen1 on failure.

Source
fetch_settings

Fetches the settings/config from the plug.

Source
fetch_status

Fetches the status from the plug.

Source