This repository was archived by the owner on Aug 6, 2025. It is now read-only.
Commit 2c1fbb0
committed
Don't error if device switched off
Previously get_device or the related functions would retrieve a list of
devices that it contacted in the last x seconds. Then we would contact
each light in turn to try and apply some sort of filtering.
This would error out if the light had been switched off.
This patch attempts to contact each light and skips it if it cannot be
contacted.
This also caches the label of the light so we can display the repr
string even if the light is offline.
Closes #61 parent b8e5c1c commit 2c1fbb0
2 files changed
Lines changed: 26 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| |||
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
185 | 199 | | |
186 | 200 | | |
187 | 201 | | |
| |||
227 | 241 | | |
228 | 242 | | |
229 | 243 | | |
230 | | - | |
| 244 | + | |
231 | 245 | | |
232 | 246 | | |
233 | 247 | | |
| |||
236 | 250 | | |
237 | 251 | | |
238 | 252 | | |
239 | | - | |
| 253 | + | |
240 | 254 | | |
241 | 255 | | |
242 | 256 | | |
| |||
245 | 259 | | |
246 | 260 | | |
247 | 261 | | |
248 | | - | |
| 262 | + | |
249 | 263 | | |
250 | 264 | | |
251 | 265 | | |
| |||
254 | 268 | | |
255 | 269 | | |
256 | 270 | | |
257 | | - | |
| 271 | + | |
258 | 272 | | |
259 | 273 | | |
260 | 274 | | |
| |||
263 | 277 | | |
264 | 278 | | |
265 | 279 | | |
266 | | - | |
| 280 | + | |
267 | 281 | | |
268 | 282 | | |
269 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
260 | | - | |
261 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
262 | 265 | | |
263 | 266 | | |
264 | 267 | | |
265 | 268 | | |
266 | 269 | | |
| 270 | + | |
267 | 271 | | |
268 | 272 | | |
269 | 273 | | |
| |||
0 commit comments