isaacrlevin / presencelight

PresenceLight is a solution to broadcast your various statuses to light bulbs.
MIT License
419 stars 77 forks source link

Set Color not working since today #847

Closed Shrekmachine closed 7 months ago

Shrekmachine commented 7 months ago

Describe the bug Hue Lights not updating color, icon is showing correct color/status.

To Reproduce Start PL

Expected behavior Colors of Hue Lights to update based on Teams status

Screenshots {"Timestamp":"2024-01-16T10:19:35.3728660+01:00","Level":"Information","MessageTemplate":"PresenceLight Running in Teams Mode - MainWindow.xaml:InteractWithLights Line: 574","Properties":{"SourceContext":"PresenceLight.MainWindow","LineNumber":574,"FilePath":"D:\a\presencelight\presencelight\src\DesktopClient\PresenceLight\MainWindow.xaml.cs","MemberName":"InteractWithLights","Application":"PresenceLight"}} {"Timestamp":"2024-01-16T10:19:35.5722696+01:00","Level":"Error","MessageTemplate":"Error Occurred Setting Color - HueService:SetColor Line: 142","Exception":"System.NullReferenceException: Object reference not set to an instance of an object.\r\n at PresenceLight.Core.HueService.SetColor(String availability, String activity, String lightId)","Properties":{"SourceContext":"PresenceLight.Core.HueService","LineNumber":142,"FilePath":"D:\a\presencelight\presencelight\src\PresenceLight.Core\Lights\HueServices\HueService.cs","MemberName":"SetColor","Application":"PresenceLight"}} {"Timestamp":"2024-01-16T10:19:35.5725516+01:00","Level":"Error","MessageTemplate":"Error occurred Setting Color - MainWindow.xaml:SetColor Line: 268","Exception":"System.NullReferenceException: Object reference not set to an instance of an object.\r\n at PresenceLight.Core.HueService.SetColor(String availability, String activity, String lightId)\r\n at PresenceLight.Core.HueServices.HueService.SetColorHandler.Handle(SetColorCommand command, CancellationToken cancellationToken)\r\n at PresenceLight.MainWindow.SetColor(String color, String activity) in D:\a\presencelight\presencelight\src\DesktopClient\PresenceLight\MainWindow.xaml.cs:line 228","Properties":{"SourceContext":"PresenceLight.MainWindow","LineNumber":268,"FilePath":"D:\a\presencelight\presencelight\src\DesktopClient\PresenceLight\MainWindow.xaml.cs","MemberName":"SetColor","Application":"PresenceLight"}}

Further details

Latest Version from MS App Store

Shrekmachine commented 7 months ago

I found the reason. All color value in the json settings file were set to null. Still, not clear to me how this can happen, if not a bug.

Shrekmachine commented 7 months ago

and is overwriting settings, again, once I fix it :/

isaacrlevin commented 7 months ago

I pushed a possible fix to Nightly

Shrekmachine commented 7 months ago

After reinstall it looks stable

isaacrlevin commented 7 months ago

Cool, I will close when it gets released