iRayanKhan / homebridge-tuya

A Homebridge plugin to control Tuya devices locally.
MIT License
395 stars 165 forks source link

Unify logs #415

Closed valentindusollier closed 8 months ago

valentindusollier commented 1 year ago

Most logs use console.log instead of the Logging object of Homebridge. I fixed it.

05TEVE commented 8 months ago

Resolved merge conflicts due to my fan speed change.

05TEVE commented 8 months ago

Changes merged into 3.1.0 branch for time being. After testing of beta is done, i will merge into main. 3.1.0-beta.5 has the changes included.

dibsies commented 8 months ago

Great work, @05TEVE ! It's so nice to see this plugin getting revived. Logs are looking a million times cleaner on latest beta. Is there any way to disable logging of adaptive lighting changes?

Example:

[15/01/2024, 16:50:59] [TuyaLan] setColorTemperature: 222 [15/01/2024, 16:50:59] [TuyaLan] setColorTemperature: 222 [15/01/2024, 16:50:59] [TuyaLan] setColorTemperature: 222 [15/01/2024, 16:50:59] [TuyaLan] setColorTemperature: 349 [15/01/2024, 16:50:59] [TuyaLan] setColorTemperature: 222 [15/01/2024, 16:50:59] [TuyaLan] setColorTemperature: 222 [15/01/2024, 16:50:59] [TuyaLan] setColorTemperature: 222 [15/01/2024, 16:51:00] [TuyaLan] setColorTemperature: 222

05TEVE commented 8 months ago

Hey , can you try with the latest beta 3.1.0-beta.13. This sets the logs as debug meaning they will only show if homebridge is running in debug mode.

dibsies commented 8 months ago

Installing beta 11 yesterday ended up shuffling my Tuya devices around in homekit. This broke my automations, scenes, and groups. I just got it all set up again and things are working great. I noticed that all of my devices have disappeared from the plugin settings page, though they still appear in the config file. Any thoughts into what might be going on?

05TEVE commented 8 months ago

Hi @dibsies,There was a change that was implemented in 2.1.0 (unreleased) that changed the plugin name to Tuya instead of TuyaLan. Earlier versions of the beta contained that change. I have since figured out a way of keeping the config as TuyaLan to prevent users coming from 2.0.1 from needing to redo their configs. I got hit by the same issue and reconfiguring all the Tuya devices HomeKit is rather inconvenient.

Can you please config what version you have upgraded from and what the plugin is named in the config json? I have tested fresh installs and the upgrade from 2.0.1 and my configs are looking to be working as expected with 3.1.0beta-14.

dibsies commented 8 months ago

I want to say I was on beta 7 before upgrading to beta 11. Prior to that my path went something like 2.01 (latest public) --> beta 3 --> beta 7 --> beta 11. My config json says "platform": "TuyaLan".

dibsies commented 8 months ago

Updated to b13 today. So far, so good. No issues with update and logs are so quiet now. Thank you for your work!

05TEVE commented 8 months ago

@dibsies.That's great to hear! Can you confirm whether the config issue is still there on version 13?

dibsies commented 8 months ago

@05TEVE config issue is gone. Everything is once again visible in the plugin settings 👍