@@ -60,51 +60,67 @@ <h2 class="section-title" id="header-classes">Classes</h2>
6060 async def getBatteryLevel(self):
6161 """Returns the battery of a blind. We currently don't know the range or meaning."""
6262 value = await self.director.getItemVariableValue(self.item_id, "Battery Level")
63+ if value is None:
64+ return None
6365 return int(value)
6466
6567 async def getClosing(self):
6668 """Returns an indication of whether the blind is moving in the closed direction as a boolean
6769 (True=closing, False=opening). If the blind is stopped, reports the direction it last moved.
6870 """
6971 value = await self.director.getItemVariableValue(self.item_id, "Closing")
72+ if value is None:
73+ return None
7074 return bool(value)
7175
7276 async def getFullyClosed(self):
7377 """Returns an indication of whether the blind is fully closed as a boolean
7478 (True=fully closed, False=at least partially open)."""
7579 value = await self.director.getItemVariableValue(self.item_id, "Fully Closed")
80+ if value is None:
81+ return None
7682 return bool(value)
7783
7884 async def getFullyOpen(self):
7985 """Returns an indication of whether the blind is fully open as a boolean
8086 (True=fully open, False=at least partially closed)."""
8187 value = await self.director.getItemVariableValue(self.item_id, "Fully Open")
88+ if value is None:
89+ return None
8290 return bool(value)
8391
8492 async def getLevel(self):
8593 """Returns the level (current position) of a blind as an int 0-100.
8694 0 is fully closed and 100 is fully open.
8795 """
8896 value = await self.director.getItemVariableValue(self.item_id, "Level")
97+ if value is None:
98+ return None
8999 return int(value)
90100
91101 async def getOpen(self):
92102 """Returns an indication of whether the blind is open as a boolean (True=open, False=closed).
93103 This is true even if the blind is only partially open."""
94104 value = await self.director.getItemVariableValue(self.item_id, "Open")
105+ if value is None:
106+ return None
95107 return bool(value)
96108
97109 async def getOpening(self):
98110 """Returns an indication of whether the blind is moving in the open direction as a boolean
99111 (True=opening, False=closing). If the blind is stopped, reports the direction it last moved.
100112 """
101113 value = await self.director.getItemVariableValue(self.item_id, "Opening")
114+ if value is None:
115+ return None
102116 return bool(value)
103117
104118 async def getStopped(self):
105119 """Returns an indication of whether the blind is stopped as a boolean
106120 (True=stopped, False=moving)."""
107121 value = await self.director.getItemVariableValue(self.item_id, "Stopped")
122+ if value is None:
123+ return None
108124 return bool(value)
109125
110126 async def getTargetLevel(self):
@@ -113,6 +129,8 @@ <h2 class="section-title" id="header-classes">Classes</h2>
113129 0 is fully closed and 100 is fully open.
114130 """
115131 value = await self.director.getItemVariableValue(self.item_id, "Target Level")
132+ if value is None:
133+ return None
116134 return int(value)
117135
118136 async def open(self):
@@ -200,6 +218,8 @@ <h3>Methods</h3>
200218< pre > < code class ="python "> async def getBatteryLevel(self):
201219 """Returns the battery of a blind. We currently don't know the range or meaning."""
202220 value = await self.director.getItemVariableValue(self.item_id, "Battery Level")
221+ if value is None:
222+ return None
203223 return int(value)</ code > </ pre >
204224</ details >
205225< div class ="desc "> < p > Returns the battery of a blind. We currently don't know the range or meaning.</ p > </ div >
@@ -217,6 +237,8 @@ <h3>Methods</h3>
217237 (True=closing, False=opening). If the blind is stopped, reports the direction it last moved.
218238 """
219239 value = await self.director.getItemVariableValue(self.item_id, "Closing")
240+ if value is None:
241+ return None
220242 return bool(value)</ code > </ pre >
221243</ details >
222244< div class ="desc "> < p > Returns an indication of whether the blind is moving in the closed direction as a boolean
@@ -234,6 +256,8 @@ <h3>Methods</h3>
234256 """Returns an indication of whether the blind is fully closed as a boolean
235257 (True=fully closed, False=at least partially open)."""
236258 value = await self.director.getItemVariableValue(self.item_id, "Fully Closed")
259+ if value is None:
260+ return None
237261 return bool(value)</ code > </ pre >
238262</ details >
239263< div class ="desc "> < p > Returns an indication of whether the blind is fully closed as a boolean
@@ -251,6 +275,8 @@ <h3>Methods</h3>
251275 """Returns an indication of whether the blind is fully open as a boolean
252276 (True=fully open, False=at least partially closed)."""
253277 value = await self.director.getItemVariableValue(self.item_id, "Fully Open")
278+ if value is None:
279+ return None
254280 return bool(value)</ code > </ pre >
255281</ details >
256282< div class ="desc "> < p > Returns an indication of whether the blind is fully open as a boolean
@@ -269,6 +295,8 @@ <h3>Methods</h3>
269295 0 is fully closed and 100 is fully open.
270296 """
271297 value = await self.director.getItemVariableValue(self.item_id, "Level")
298+ if value is None:
299+ return None
272300 return int(value)</ code > </ pre >
273301</ details >
274302< div class ="desc "> < p > Returns the level (current position) of a blind as an int 0-100.
@@ -286,6 +314,8 @@ <h3>Methods</h3>
286314 """Returns an indication of whether the blind is open as a boolean (True=open, False=closed).
287315 This is true even if the blind is only partially open."""
288316 value = await self.director.getItemVariableValue(self.item_id, "Open")
317+ if value is None:
318+ return None
289319 return bool(value)</ code > </ pre >
290320</ details >
291321< div class ="desc "> < p > Returns an indication of whether the blind is open as a boolean (True=open, False=closed).
@@ -304,6 +334,8 @@ <h3>Methods</h3>
304334 (True=opening, False=closing). If the blind is stopped, reports the direction it last moved.
305335 """
306336 value = await self.director.getItemVariableValue(self.item_id, "Opening")
337+ if value is None:
338+ return None
307339 return bool(value)</ code > </ pre >
308340</ details >
309341< div class ="desc "> < p > Returns an indication of whether the blind is moving in the open direction as a boolean
@@ -321,6 +353,8 @@ <h3>Methods</h3>
321353 """Returns an indication of whether the blind is stopped as a boolean
322354 (True=stopped, False=moving)."""
323355 value = await self.director.getItemVariableValue(self.item_id, "Stopped")
356+ if value is None:
357+ return None
324358 return bool(value)</ code > </ pre >
325359</ details >
326360< div class ="desc "> < p > Returns an indication of whether the blind is stopped as a boolean
@@ -340,6 +374,8 @@ <h3>Methods</h3>
340374 0 is fully closed and 100 is fully open.
341375 """
342376 value = await self.director.getItemVariableValue(self.item_id, "Target Level")
377+ if value is None:
378+ return None
343379 return int(value)</ code > </ pre >
344380</ details >
345381< div class ="desc "> < p > Returns the target level (desired position) of a blind as an int 0-100.
0 commit comments