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

TPLinkSmartBulb cannot be used as a method #3

Closed pekempy closed 5 years ago

pekempy commented 5 years ago

Hi,

I've added the DLL as a reference and it seems to be picking most things up ok but I've got an error that I can't use "TPLinkSmartBulb" as it's shown in the readme - see below. Also, readme may have an error as it shows "smartBulb.PoweredOff = false; //turns off the bulb" - should that be smartBulb.PoweredOn = false; ?

image

TheBauwssss commented 5 years ago

Just off the top of my head I'm pretty sure you need to use the new keyword.

TheBauwssss commented 5 years ago

2019-05-17_15-10-48

Yes this appears to fix the example for me. It is probably a simple oversight or a remnant from an older architecture. I do not have the privileges required to push to this repo. If you're feeling up to it you could edit the README.md yourself and submit a pull request :)

pekempy commented 5 years ago

I think it might've been a long week at work! Can't believe I missed that. thanks Created PR https://github.com/anthturner/TPLinkSmartDevices/pull/5/files