janstol / yeedart

Simple Dart library that lets you control Yeelight devices over LAN.
MIT License
10 stars 4 forks source link

Errro Yeelight.discover Null check operator used on a null value #12

Closed guyluz11 closed 1 year ago

guyluz11 commented 2 years ago

While using the Yeelight.discover function I am getting

Null check operator used on a null value

Crash.

I have several smart devices in my home but currently it does not include any Yeelight devices.

The code is crashing inside

factory DiscoveryResponse.fromRawResponse(String rawResponse) {

and rawResponse

Value is

M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1982
MAN: \"ssdp:discover\"
ST: wifi_bulb

Crashes on line 173

final match = regExp.firstMatch(rawResponse)!;

guyluz11 commented 1 year ago

It looks like it is finding the current computer running the program.

Using datagram.address.address I found that it crushed on my computer IP, it is a regular computer so there is no Yeelight device here. I think this crush has something to do with it that I currently do not have any Yeelight devices in the network. Tested and it does not seem that my computer has Yeelight port 1982 open.