shellyprober

package
v0.0.0-...-0c72a7a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShellyProberGen1

type ShellyProberGen1 struct {
	Target discovery.DiscoveryTarget
	Client *resty.Client
	Ctx    context.Context
	Cache  *cache.Cache
}

func (*ShellyProberGen1) GetSettings

func (*ShellyProberGen1) GetStatus

type ShellyProberGen1ResultPowerUsage

type ShellyProberGen1ResultPowerUsage struct {
	Power     float64   `json:"power"`
	Overpower float64   `json:"overpower"`
	IsValid   bool      `json:"is_valid"`
	Timestamp int       `json:"timestamp"`
	Counters  []float64 `json:"counters"`
	Total     int       `json:"total"`
}

type ShellyProberGen1ResultSettings

type ShellyProberGen1ResultSettings struct {
	Name     string  `json:"name"`
	MaxPower float64 `json:"max_power"`
	Fw       string  `json:"fw"`

	Device struct {
		Hostname string `json:"hostname"`
		Mac      string `json:"mac"`
		Type     string `json:"type"`
	} `json:"device"`
}

type ShellyProberGen1ResultStatus

type ShellyProberGen1ResultStatus struct {
	WifiSta struct {
		Connected bool   `json:"connected"`
		Ssid      string `json:"ssid"`
		IP        string `json:"ip"`
		Rssi      int    `json:"rssi"`
	} `json:"wifi_sta"`
	Cloud struct {
		Enabled   bool `json:"enabled"`
		Connected bool `json:"connected"`
	} `json:"cloud"`
	Mqtt struct {
		Connected bool `json:"connected"`
	} `json:"mqtt"`
	Time          string `json:"time"`
	Unixtime      int    `json:"unixtime"`
	Serial        int    `json:"serial"`
	HasUpdate     bool   `json:"has_update"`
	Mac           string `json:"mac"`
	CfgChangedCnt int    `json:"cfg_changed_cnt"`
	ActionsStats  struct {
		Skipped int `json:"skipped"`
	} `json:"actions_stats"`
	Relays []struct {
		Ison           bool   `json:"ison"`
		HasTimer       bool   `json:"has_timer"`
		TimerStarted   int    `json:"timer_started"`
		TimerDuration  int    `json:"timer_duration"`
		TimerRemaining int    `json:"timer_remaining"`
		Overpower      bool   `json:"overpower"`
		Source         string `json:"source"`
	} `json:"relays"`
	Meters []struct {
		Power     float64   `json:"power"`
		Overpower float64   `json:"overpower"`
		IsValid   bool      `json:"is_valid"`
		Timestamp int       `json:"timestamp"`
		Counters  []float64 `json:"counters"`
		Total     float64   `json:"total"`
	} `json:"meters"`
	Temperature     float64 `json:"temperature"`
	Overtemperature bool    `json:"overtemperature"`
	Tmp             struct {
		TC      float64 `json:"tC"`
		TF      float64 `json:"tF"`
		IsValid bool    `json:"is_valid"`
	} `json:"tmp"`
	Update struct {
		Status     string `json:"status"`
		HasUpdate  bool   `json:"has_update"`
		NewVersion string `json:"new_version"`
		OldVersion string `json:"old_version"`
	} `json:"update"`
	RAMTotal int `json:"ram_total"`
	RAMFree  int `json:"ram_free"`
	FsSize   int `json:"fs_size"`
	FsFree   int `json:"fs_free"`
	Uptime   int `json:"uptime"`
}

type ShellyProberGen2

type ShellyProberGen2 struct {
	Target discovery.DiscoveryTarget
	Client *resty.Client
	Ctx    context.Context
	Cache  *cache.Cache
}

func (*ShellyProberGen2) GetEmDataStatus

func (sp *ShellyProberGen2) GetEmDataStatus(id int) (ShellyProberGen2ResultEmData, error)

func (*ShellyProberGen2) GetEmStatus

func (sp *ShellyProberGen2) GetEmStatus(id int) (ShellyProberGen2ResultEm, error)

func (*ShellyProberGen2) GetShellyConfig

func (*ShellyProberGen2) GetSwitchStatus

func (sp *ShellyProberGen2) GetSwitchStatus(id int) (ShellyProberGen2ResultSwitch, error)

func (*ShellyProberGen2) GetSysStatus

func (*ShellyProberGen2) GetTemperatureStatus

func (sp *ShellyProberGen2) GetTemperatureStatus(id int) (ShellyProberGen2ResultTemperature, error)

func (*ShellyProberGen2) GetWifiStatus

type ShellyProberGen2ResultEm

type ShellyProberGen2ResultEm struct {
	ID                  int     `json:"id"`
	ACurrent            float64 `json:"a_current"`
	AVoltage            float64 `json:"a_voltage"`
	AActPower           float64 `json:"a_act_power"`
	AAprtPower          float64 `json:"a_aprt_power"`
	APf                 float64 `json:"a_pf"`
	AFreq               float64 `json:"a_freq"`
	BCurrent            float64 `json:"b_current"`
	BVoltage            float64 `json:"b_voltage"`
	BActPower           float64 `json:"b_act_power"`
	BAprtPower          float64 `json:"b_aprt_power"`
	BPf                 float64 `json:"b_pf"`
	BFreq               float64 `json:"b_freq"`
	CCurrent            float64 `json:"c_current"`
	CVoltage            float64 `json:"c_voltage"`
	CActPower           float64 `json:"c_act_power"`
	CAprtPower          float64 `json:"c_aprt_power"`
	CPf                 float64 `json:"c_pf"`
	CFreq               float64 `json:"c_freq"`
	NCurrent            any     `json:"n_current"`
	TotalCurrent        float64 `json:"total_current"`
	TotalActPower       float64 `json:"total_act_power"`
	TotalAprtPower      float64 `json:"total_aprt_power"`
	UserCalibratedPhase []any   `json:"user_calibrated_phase"`
}

type ShellyProberGen2ResultEmData

type ShellyProberGen2ResultEmData struct {
	ID                 int     `json:"id"`
	ATotalActEnergy    float64 `json:"a_total_act_energy"`
	ATotalActRetEnergy float64 `json:"a_total_act_ret_energy"`
	BTotalActEnergy    float64 `json:"b_total_act_energy"`
	BTotalActRetEnergy float64 `json:"b_total_act_ret_energy"`
	CTotalActEnergy    float64 `json:"c_total_act_energy"`
	CTotalActRetEnergy float64 `json:"c_total_act_ret_energy"`
	TotalAct           float64 `json:"total_act"`
	TotalActRet        float64 `json:"total_act_ret"`
}

type ShellyProberGen2ResultShellyConfig

type ShellyProberGen2ResultShellyConfig map[string]interface{}

type ShellyProberGen2ResultSwitch

type ShellyProberGen2ResultSwitch struct {
	ID      int     `json:"id"`
	Source  string  `json:"source"`
	Output  bool    `json:"output"`
	Apower  float64 `json:"apower"`
	Voltage float64 `json:"voltage"`
	Current float64 `json:"current"`
	Aenergy struct {
		Total    float64   `json:"total"`
		ByMinute []float64 `json:"by_minute"`
		MinuteTs float64   `json:"minute_ts"`
	} `json:"aenergy"`
	Temperature struct {
		TC float64 `json:"tC"`
		TF float64 `json:"tF"`
	} `json:"temperature"`
}

type ShellyProberGen2ResultSysStatus

type ShellyProberGen2ResultSysStatus struct {
	Mac              string `json:"mac"`
	RestartRequired  bool   `json:"restart_required"`
	Time             string `json:"time"`
	Unixtime         int    `json:"unixtime"`
	Uptime           int    `json:"uptime"`
	RAMSize          int    `json:"ram_size"`
	RAMFree          int    `json:"ram_free"`
	FsSize           int    `json:"fs_size"`
	FsFree           int    `json:"fs_free"`
	CfgRev           int    `json:"cfg_rev"`
	KvsRev           int    `json:"kvs_rev"`
	ScheduleRev      int    `json:"schedule_rev"`
	WebhookRev       int    `json:"webhook_rev"`
	AvailableUpdates struct {
		Stable struct {
			Version string `json:"version"`
		} `json:"stable"`
	} `json:"available_updates"`
}

type ShellyProberGen2ResultTemperature

type ShellyProberGen2ResultTemperature struct {
	ID int     `json:"id"`
	TC float64 `json:"tC"`
	TF float64 `json:"tF"`
}

type ShellyProberGen2ResultWifiStatus

type ShellyProberGen2ResultWifiStatus struct {
	StaIP  string `json:"sta_ip"`
	Status string `json:"status"`
	Ssid   string `json:"ssid"`
	Rssi   int    `json:"rssi"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL