status

package
v0.0.0-...-c1be4bf Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterStatus

type FilterStatus struct {
	ChangedAt time.Time `json:"changed_at"`
	RemindAt  time.Time `json:"remind_at"`
	ChangeDue bool      `json:"change_due"`
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(
	mctx *monitor.MonitorContext,
	store StatusStore,
	sensors sensor.Sensors,
	originPatterns []string,
) *Handler

func (*Handler) RegisterRoutes

func (h *Handler) RegisterRoutes(mux *http.ServeMux)

type OzoneStatus

type OzoneStatus struct {
	Running     bool      `json:"running"`
	StartTime   time.Time `json:"start_time"`
	EndTime     time.Time `json:"end_time"`
	Status      string    `json:"status"`
	SecondsLeft float64   `json:"seconds_left"`
}

type PlungeState

type PlungeState struct {
	MU             sync.Mutex
	WaterTempTotal float64
	RoomTempTotal  float64
	TempReadCount  int64
}

type PlungeStatus

type PlungeStatus struct {
	StartTime      time.Time `json:"start_time"`
	EndTime        time.Time `json:"end_time"`
	StartWaterTemp string    `json:"start_water_temp"`
	StartRoomTemp  string    `json:"start_room_temp"`
	EndWaterTemp   string    `json:"end_water_temp"`
	EndRoomTemp    string    `json:"end_room_temp"`

	Running          bool    `json:"running"`
	ExpectedDuration int32   `json:"expected_duration"`
	Remaining        float64 `json:"remaining_time"`
	ElapsedTime      float64 `json:"elapsed_time"`
	AvgWaterTemp     float64 `json:"average_water_temp"`
	AvgRoomTemp      float64 `json:"average_room_temp"`
}

type StatusStore

type StatusStore interface {
	FindMostRecentTemperatures(ctx context.Context) (database.Temperature, error)
	GetLatestPlunge(ctx context.Context) (database.Plunge, error)
	UpdatePlungeAvgTemp(ctx context.Context, arg database.UpdatePlungeAvgTempParams) (database.Plunge, error)
	GetLatestOzoneEntry(ctx context.Context) (database.Ozone, error)
	GetLatestFilterChange(ctx context.Context) (database.Filter, error)
}

type SystemStatus

type SystemStatus struct {
	AlertMessages []string     `json:"alert_messages"`
	ErrorMessages []string     `json:"error_messages"`
	WaterTemp     float64      `json:"water_temp"`
	RoomTemp      float64      `json:"room_temp"`
	LeakDetected  bool         `json:"leak_detected"`
	PumpOn        bool         `json:"pump_on"`
	PlungeStatus  PlungeStatus `json:"plunge"`
	OzoneStatus   OzoneStatus  `json:"ozone"`
	FilterStatus  FilterStatus `json:"filter"`
}

Jump to

Keyboard shortcuts

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