Thanks - I gave it a whirl. Unfortunately, I think I have a tweener. I have an HS220 dimming light switch - not a bulb. In essence, I believe, it's a relay with a dimmer. The old plugin worked fine with my HS220 except I had no capability to change the dimmer state - so if it were set to 50% with the iPhone app, Indigo could turn on/off at 50%. I believe your new code is for a bulb, which as you said, is a different JSON.
Here was my error log when I tried to set up a new device using the beta:
1) for dimmable bulb:
Feb 2, 2021 at 5:58:45 PM
TP-Link Devices Error (plugin.py:getSubType:115): model HS220 is not recognised
TP-Link Devices Error Error in plugin execution UiAction:
Traceback (most recent call last):
File "plugin.py", line 500, in selectTpDevice
File "/Library/Application Support/Perceptive Automation/Indigo 7.5/Plugins/TP-Link-Device.indigoPlugin/Contents/Server Plugin/tplink_dimmer_plugin.py", line 106, in selectTpDevice
KeyError: ('mic_mac',)
TP-Link Devices Error Error in plugin execution ServerReplacedElem:
Traceback (most recent call last):
File "/Library/Application Support/Perceptive Automation/Indigo 7.5/IndigoPluginHost.app/Contents/Resources/PlugIns/plugin_base.py", line 1179, in deviceUpdated
File "plugin.py", line 219, in deviceStartComm
KeyError: key model not found in dict
2) for smartplug
TP-Link Devices Error (plugin.py:getSubType:115): model HS220 is not recognised
TP-Link Devices Error Error in plugin execution ServerReplacedElem:
Traceback (most recent call last):
File "/Library/Application Support/Perceptive Automation/Indigo 7.5/IndigoPluginHost.app/Contents/Resources/PlugIns/plugin_base.py", line 1179, in deviceUpdated
File "plugin.py", line 225, in deviceStartComm
File "/Library/Application Support/Perceptive Automation/Indigo 7.5/Plugins/TP-Link-Device.indigoPlugin/Contents/Server Plugin/tplink_relay_plugin.py", line 51, in deviceStartComm
NameError: global name 'description' is not defined
This may help:
https://python-kasa.readthedocs.io/en/latest/