HEMS: make Dimmed/Curtailed tri-state (once more) (#30712)
This commit is contained in:
parent
d859ae9c7c
commit
45cab34ce9
10 changed files with 32 additions and 31 deletions
|
|
@ -137,15 +137,16 @@ func (c *Relay) setConsumptionLimit(limit float64) error {
|
|||
var _ api.HEMS = (*Relay)(nil)
|
||||
|
||||
// Dimmed implements api.HEMS, derived from the active consumption limit.
|
||||
func (c *Relay) Dimmed() bool {
|
||||
func (c *Relay) Dimmed() *bool {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
return c.limit != nil
|
||||
return new(c.limit != nil)
|
||||
}
|
||||
|
||||
// Curtailed implements api.HEMS. Relay does not curtail production.
|
||||
func (c *Relay) Curtailed() bool {
|
||||
return false
|
||||
// Curtailed implements api.HEMS. Relay does not curtail production and
|
||||
// hence makes no statement.
|
||||
func (c *Relay) Curtailed() *bool {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MaxConsumptionPower implements api.HEMS, returning the active wattage cap.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue