Conversation
Changes to TPLinkManager to better handle discovered devices
Added a configurable timeout setting to device config Exposed getConfig to public to allow easy querying of a devices config Added powerOn, powerOff and powerStatus direct methods
…meout setting Stopped stream_socket_client from generating warnings
…ksmartplug into feature/auto_discovery
…ksmartplug into feature/auto_discovery
…ksmartplug into feature/auto_discovery
…ksmartplug into feature/auto_discovery
Removed supression of stream_socker_client errors
# Conflicts: # src/TPLinkDevice.php
…config Renamed newTPLinkDevice to newDevice to simplify Added various missing comment text Fixed bug where IP where not resolving to string
…function to halt for a long period of time - Fixed bug with the auto discovery function
…fferent commands based on device type E.G plug / bulb
…his allows auto discovery and if you know you have x devices, no point in scanning the rest of the IP range if you have discovered all x devices already
…ols / brightness control
| "require": { | ||
| "tightenco/collect": "^5.3" | ||
| "tightenco/collect": "^5.3", | ||
| "s1lentium/iptools": "^1.1" |
There was a problem hiding this comment.
The latest commit in this library has been tagged at 1.1.1 so using * previously here isn't necessary/a great practice
|
So I've finally gotten a new TPLink device, one with v2 hardware and and I can now test all these features. I'm wondering if you can fill me in on a few things. Can you give me a use case for the auto detect feature. I can test the code and see that it works to discover the devices on the network....but for what purpose? Unless I've missed it I can't see any persistence of this information BACK into the config file etc? So are you saving this info else where to use at a later stage? Or do you always scan before sending a command to your devices? This seems a very slow way to do things. Commit b348685 is a tweak at some of your code. Thanks. |
The main reason for it was either during development to easily scan the network to find all your devices, I have 7 units across the house. I also dont use static IPs and was finding everynow and again the devices would lose there assigned IP and I would then need to edit the configs. This was my way to get around this, for example I setup a cronjob to run a artisan command every 24 hours to just check and update the configs / save the new IP address details to a database, I would then talk to the devices using the latest data in the database and/or populate the config variable so I can still hardcode values in the config if I wanted to. I added the $maxDiscoveredDevices paramater, as it helps speed up the discovery side by looking for x number of devices, once we have all x found we know there is no more and stop discovering. I didnt permentatly save the discovered device data into the config, as I never got around to it and wasnt 100% sure all users would want this. Maybe a new "->saveDeviceConfig()" option would be viable to allow the user the option to save the config after a discovery (im using a DB so wasnt 100% required for my usage at this point but would allow me to get rid of the DB in the future). |
Ah I see. Yes I can see why you did this....although I think its funny that you spent so much time writing new code, scanning, sending to a database, making a cron job etc etc rather than just assign static IP addresses in your router!! Still the code is written now and it does work so that's fine. I don't think I have any need/interest to expand on it at the moment though. I just thought I was missing something with regards how the results were persisted. With regards to the code for all the lights and dimming etc are you happy that this all works as I have no plans of getting these devices and so cannot test that the code is working? If it's all working then I'll merge this all. Thanks for the PRs |
Unfortunately certain people in my house hold think doing a hard reset on the route every couple weeks is a good thing to keep it healthy.... losing all the static range and then I would end up with DHCP allocating IPs causing massive conflicts. |
I will upload a video this evening :) |
|
Oh - one more thing can you tell me what model number of smart bulbs can be controlled with your code? Thanks. |
No description provided.