andersevenrud / ha-nexa-bridge-x

Home Assistant - Nexa Bridge X Integration
Other
9 stars 3 forks source link

Light should use binary capability to turn on/off if available #25

Closed andersevenrud closed 7 months ago

andersevenrud commented 1 year ago

Currently a Light Entity uses the switchLevel capability to turn on/off with a numeric value (1.0/0.0).

In some cases a device can have both switchLevel and switchBinary (true/false) which means it should turn on/off using the binary capability instead. A side effect of this might be that the previous level value is restored when turning a light back on (which I suppose is a good thing).

I don't have a device capable of this though...

andersevenrud commented 7 months ago

This is probably not relevant anymore. A binary sensor is represented as a switch and a level sensor is represented as a light.

The "Light" entity cannot be both a on/off and brightness. So just relying on the Binary Switch and Light entities should suffice.

Ref: https://github.com/andersevenrud/ha-nexa-bridge-x/issues/36#issuecomment-2033021283