anthturner / TPLinkSmartDevices

C# Library for Discovering and Operating TP-Link Smart Devices (HS100/105/110, LB100/110/120/130)
Apache License 2.0
40 stars 18 forks source link

sysinfo was null after adding a 100 #7

Open blubbll opened 4 years ago

blubbll commented 4 years ago

at https://github.com/anthturner/TPLinkSmartDevices/blob/master/TPLinkSmartDevices/TPLinkDiscovery.cs#L64

i had to

            if (sys_info != null || sys_info != new object { })
            {
                string model = (string)sys_info.model;
                if (model.StartsWith("HS110"))
                    device = new TPLinkSmartMeterPlug(ip.Address.ToString());
                else if (model.StartsWith("HS"))
                    device = new TPLinkSmartPlug(ip.Address.ToString());
                else if (model.StartsWith("LB"))
                    device = new TPLinkSmartBulb(ip.Address.ToString());

                if (device != null)
                    DiscoveredDevices.Add(device);
            }

because i keep getting an empty object.

is this normal? freshly set up plug.

thanks

AndrewKlasen commented 4 years ago

I'm having the same issue, any fix?

TheBauwssss commented 4 years ago

Could you provide a full text dump for the sys_info JSON-object and/or the contents of the message variable?

bauland commented 3 years ago

Content of message is: "{\"system\":{\"get_sysinfo\":null},\"emeter\":{\"get_realtime\":null}}"