hmenzagh / homebridge-tuya-platform-local

Unofficial Homebridge plugin enabling local control of Tuya smart devices
MIT License
1 stars 2 forks source link

Fix illegal value warning for CurrentAmbientLightLevel #6

Open sapireli opened 4 months ago

sapireli commented 4 months ago

This commit resolves the warning "characteristic was supplied illegal value: number 0 exceeded minimum of 0.0001" for the CurrentAmbientLightLevel characteristic.

The changes include:

By clamping the values, we prevent the plugin from setting an illegal value for the CurrentAmbientLightLevel characteristic, which was causing the warning to be generated.

This fix should eliminate the warning when the plugin first starts, as well as during subsequent updates from the device.