colinodell / python-qnapstats

Python API for obtaining QNAP NAS system stats
Other
73 stars 30 forks source link

TS-251 NoneType Error #56

Closed jrsaxe closed 3 years ago

jrsaxe commented 3 years ago

Please provide the following information along with your issue report (replace anything inside of <>):

Device Model Number:

QTS Version: <4.5.2.1630>

I'm having an issued with a TS-251, which another poster confirmed is not on the supported list. The login appears to work as I show the HA account I created on the NAS as logged in.

XML/Debug Output:

2021-04-18 23:09:21 ERROR (SyncWorker_5) [homeassistant.components.qnap.sensor] Failed to fetch QNAP stats from the NAS                     
Traceback (most recent call last):                                                                                                          
  File "/usr/src/homeassistant/homeassistant/components/qnap/sensor.py", line 193, in update                                                
    self.data["system_stats"] = self._api.get_system_stats()                                                                                
  File "/usr/local/lib/python3.8/site-packages/qnapstats/qnap_stats.py", line 273, in get_system_stats                                      
    for dns in root["dnsInfo"]["DNS_LIST"]:                                                                                                 
TypeError: 'NoneType' object is not subscriptable   
julien-bouquet commented 3 years ago

Hello, i confirm, on TS-251 or TS-251 DNS is not managed. I open Pull Request #63 to avoid TypeError.