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 and later devices include a "gen" field in their response and all serve the same RPC API, so Gen3 and Gen4 are handled as Gen2. 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