-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NameError: name 'DeviceException' is not defined #4
Comments
Sorry to raise this issue with the duplicated title. The previous one does not provide logs. |
Also wonder if components support 1A as well? If not, any possible to update it? Or if you need any data to support it. Thank you. |
1A error 1A Sun Dec 02 2018 16:10:20 GMT+0800 (CST) Error while setting up platform mi_water_purifier During handling of the above exception, another exception occurred: Traceback (most recent call last): Sun Dec 02 2018 16:10:20 GMT+0800 (CST) unable to parse json '{"result":[net],"id":1}': Expecting value: line 1 column 12 (char 11) |
@RavenKong @bluefoxlee @ptlinzx
This is a weird error message since I saw it sometimes when the component can't get data from device and try to raise an exception. I also confused why we saw this error message since DeviceException is already imported in code. But I think the main problem of the logs you pasted is the miio library which this component uses to fetch data from xiaomi IOT devices can't get data from water purifier.
|
I just updated code and try to solve the weird issue that raised "name 'DeviceException' is not defined" when device isn't reachable. |
@bit3725 I will download the updated one and report here. Update: Still got "TypeError: 'NoneType' object is not subscriptable." |
I'm using hass.io version 0.82.1
My device model is Xiaomi water purifier 1A.
It seems the setup of the platform failed due to a "name error" which could possibly be caused by mismatching versions of the python dependencies.
Below is the error logs:
`018-11-25 00:18:42 ERROR (SyncWorker_7) [miio.protocol] unable to parse json '{"result":[net],"id":1}': Expecting value: line 1 column 12 (char 11)
2018-11-25 00:18:42 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform mi_water_purifier
Traceback (most recent call last):
File "/config/custom_components/sensor/mi_water_purifier.py", line 159, in parse_data
status = self._device.send('get_prop', [])
File "/usr/local/lib/python3.6/site-packages/miio/device.py", line 263, in send
self.__id = m.data.value["id"]
TypeError: 'NoneType' object is not subscriptable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/sensor/mi_water_purifier.py", line 34, in setup_platform
waterPurifier = XiaomiWaterPurifier(device, name)
File "/config/custom_components/sensor/mi_water_purifier.py", line 116, in init
self.parse_data()
File "/config/custom_components/sensor/mi_water_purifier.py", line 177, in parse_data
except DeviceException:
NameError: name 'DeviceException' is not defined`
The text was updated successfully, but these errors were encountered: