HEMS: make Dimmed/Curtailed tri-state (once more) (#30712)

This commit is contained in:
andig 2026-06-10 22:16:58 +02:00 • committed by GitHub
parent d859ae9c7c
commit 45cab34ce9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 32 additions and 31 deletions

View file

@ -223,25 +223,25 @@ func (c *Fnn) setConsumptionLimit(limit float64) error {
var _ api.HEMS = (*Fnn)(nil)
// Dimmed implements api.HEMS.
func (c *Fnn) Dimmed() bool {
func (c *Fnn) Dimmed() *bool {
if c.w4 == nil {
return false
return nil
}
c.mu.Lock()
defer c.mu.Unlock()
return c.consumptionLimit > 0
return new(c.consumptionLimit > 0)
}
// Curtailed implements api.HEMS.
func (c *Fnn) Curtailed() bool {
func (c *Fnn) Curtailed() *bool {
if c.w3 == nil {
return false
return nil
}
c.mu.Lock()
defer c.mu.Unlock()
return c.productionLimit != nil
return new(c.productionLimit != nil)
}
// MaxConsumptionPower implements api.HEMS.