You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
device = client.get_device('10008ecfd9') #single channel device
device2 = client.get_device('10007fgah9') #four channel device
print(device.params)
#Raw device specific properties
#can be accessed easily like: device.params.switch or device.params['startup'] (a subclass of dict)
print(device.state)
print(device.created_at)
print("Brand Name:", device.brand.name, "Logo URL:", device.brand.logo.url)
print("Device online?", device.online)
try:
await device.on()
except DeviceOffline:
print("Device is offline!")
However, I got error telling my device become NoneType
Here is the error log:
Region.AS
ClientInfo(version='4.23.0', imei='ECCD89A0-A5AE-4756-8A31-71FEC4305BDB', model='iPhone_iPhone12,8', os='iOS', rom_version='15.5')
[<Device name=Deviceede5e3 id=1000ede5e3 switch=Power.off online?=True type=DeviceType.OSPF network=Network(ssid=None, sta_mac='C8:2B:96:61:6D:31')>]
Traceback (most recent call last):
File "D:\AUTOSAFE\AUTOSAFE_WARNING_LIGHT\ewelink-api-python-master\test.py", line 5, in
async def main(client: Client):
File "D:\AUTOSAFE\AUTOSAFE_WARNING_LIGHT\ewelink-api-python-master\ewelink\client.py", line 94, in decorator
result = asyncio.get_event_loop().run_until_complete(f(client))
File "D:\Users\Michael Abner\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "D:\AUTOSAFE\AUTOSAFE_WARNING_LIGHT\ewelink-api-python-master\test.py", line 14, in main
print(device.params)
AttributeError: 'NoneType' object has no attribute 'params'
Would like to ask whats the meaning of the error and how to solve them, Thanks!!
The text was updated successfully, but these errors were encountered:
So I tried to connect my ewelink device via the example in the documentation
which is import ewelink
from ewelink import Client, DeviceOffline
@ewelink.login('password', 'user.address@email.com')
async def main(client: Client):
print(client.region)
print(client.user.info)
print(client.devices)
However, I got error telling my device become NoneType
Here is the error log:
Region.AS
ClientInfo(version='4.23.0', imei='ECCD89A0-A5AE-4756-8A31-71FEC4305BDB', model='iPhone_iPhone12,8', os='iOS', rom_version='15.5')
[<Device name=Deviceede5e3 id=1000ede5e3 switch=Power.off online?=True type=DeviceType.OSPF network=Network(ssid=None, sta_mac='C8:2B:96:61:6D:31')>]
Traceback (most recent call last):
File "D:\AUTOSAFE\AUTOSAFE_WARNING_LIGHT\ewelink-api-python-master\test.py", line 5, in
async def main(client: Client):
File "D:\AUTOSAFE\AUTOSAFE_WARNING_LIGHT\ewelink-api-python-master\ewelink\client.py", line 94, in decorator
result = asyncio.get_event_loop().run_until_complete(f(client))
File "D:\Users\Michael Abner\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "D:\AUTOSAFE\AUTOSAFE_WARNING_LIGHT\ewelink-api-python-master\test.py", line 14, in main
print(device.params)
AttributeError: 'NoneType' object has no attribute 'params'
Would like to ask whats the meaning of the error and how to solve them, Thanks!!
The text was updated successfully, but these errors were encountered: