elad-bar / ha-edgeos

Integration with EdgeOS (Ubiquiti)
133 stars 24 forks source link

Update binary_sensor.py is_on to match switch.py #75

Closed mastermc0 closed 1 year ago

mastermc0 commented 1 year ago

This resolves #69

elad-bar commented 1 year ago

thanks for raising this issue and the PR, I prefer not to update the core as it's shared core between many custom components, specifically for that case - switch's state is boolean as opposed to binary_sensor which is on / off.

the reason it's not working is because I cloned the switch to binary sensor and didn't update it, will release new version soon with the fix in the binary_sensor creation:

state = STATE_ON if interface.up else STATE_OFF