diff --git a/README.md b/README.md index 5d0d824..21cb330 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,11 @@ sensor: - DISK_USED # 可选,已用硬盘 - SWAP_USED # 可选,已用SWAP - VPS_IP # 可选,VPS IP + - SSH_PORT + - HOSTNAME + - OS + - NODE_LOCATION + - DATA_NEXT_RESET ``` 以上信息请从搬瓦工的控制页面获取。 diff --git a/custom_components/bandwagonhost/sensor.py b/custom_components/bandwagonhost/sensor.py index fd39fb5..d5ccdc6 100644 --- a/custom_components/bandwagonhost/sensor.py +++ b/custom_components/bandwagonhost/sensor.py @@ -28,10 +28,11 @@ 'VPS_LOAD_5M':['VPS LOAD 5M', '', 'mdi:cpu-32-bit'], 'VPS_LOAD_15M':['VPS LOAD 15M', '', 'mdi:cpu-32-bit'], 'VPS_IP':['VPS IP', '', 'mdi:ip'], - 'SSH_PORT':['SSH_PORT', '', 'mdi:ip'], + 'SSH_PORT':['SSH PORT', '', 'mdi:ip'], 'HOSTNAME':['HOSTNAME', '', 'mdi:ip'], 'OS':['OS', '', 'mdi:ip'], - 'NODE_LOCATION':['NODE_LOCATION', '', 'mdi:ip'], + 'NODE_LOCATION':['NODE LOCATION', '', 'mdi:ip'], + 'DATA_NEXT_RESET':['DATA NEXT RESET', '', 'mdi:ip'], } SCAN_INTERVAL = timedelta(seconds=1200) @@ -166,6 +167,8 @@ def update(self): self._state = json_obj_info['os'] elif self._condition == 'NODE_LOCATION': self._state = json_obj_info['node_location'] + elif self._condition == 'DATA_NEXT_RESET': + self._state = json_obj_info['data_next_reset'] else: self._state = "something wrong" except ConnectionError: