class
ShellyplugExporter::PlugClient
- ShellyplugExporter::PlugClient
- Reference
- Object
Overview
Handles HTTP communication with a single Shelly plug device.
Defined in:
shellyplug_exporter/plug_client.crConstant Summary
-
CONNECT_TIMEOUT =
4.seconds -
READ_TIMEOUT =
4.seconds -
SHELLY_ENDPOINT =
"/shelly"
Constructors
Instance Method Summary
-
#detect_generation : PlugGeneration
Detects the plug generation by probing the /shelly endpoint.
-
#fetch_settings : HTTP::Client::Response
Fetches the settings/config from the plug.
-
#fetch_status : HTTP::Client::Response
Fetches the status from the plug.
Constructor Detail
Instance Method Detail
def detect_generation : PlugGeneration
#
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.