hi i have been tring to find hexkey from checksum found this code but there is something wrong can any one help and do some corrections its on python
import decora
import sys
address = sys.argv[1]
switch = decora.decora(address, None)
rawkey = switch.read_key()
if rawkey == "LEVI":
print("Switch is not in pairing mode - hold down until green light flashes\n")
else: key = int(ord(rawkey[0])) << 24 | int(ord(rawkey[1])) << 16 | int(ord(rawkey[2])) << 8 | int(ord(rawkey[3]))
print(hex(key))
Using a Bluetooth switches software to find an hexkey from the checksum is the most random thing i have ever seen in this forum. So lets talk about python-decora:
Example useThis will connect and turn on the light
import decora
switch = decora.decora("00:21:4d:00:00:01", key="key")
switch.connect()
switch.on()
This will set the light to 50% intensity
switch.set_brightness(50)
And turn the lights off
Source:
https://github.com/mjg59/python-decoraIf you want to learn how to encrypt or decrypt an hexkey, you can start here:
https://secretscan.org/PrivateKeyHex