volkswagencarnet 5.0.0b3__py3-none-any.whl → 5.0.0b4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of volkswagencarnet might be problematic. Click here for more details.

@@ -2,13 +2,14 @@
2
2
 
3
3
  # Thanks to molobrakos
4
4
 
5
- from datetime import datetime
6
5
  import logging
6
+ from datetime import datetime
7
7
 
8
8
  from .vw_const import TEMP_CELSIUS, VWDeviceClass, VWStateClass
9
9
  from .vw_utilities import camel2slug
10
10
  from .vw_vehicle import Vehicle
11
11
 
12
+
12
13
  _LOGGER = logging.getLogger(__name__)
13
14
 
14
15
 
@@ -26,7 +27,7 @@ class Instrument:
26
27
  entity_type: str | None = None,
27
28
  device_class: str | None = None,
28
29
  state_class: str | None = None,
29
- ) -> None:
30
+ ):
30
31
  """Init."""
31
32
  self.attr = attr
32
33
  self.component = component
@@ -43,6 +44,7 @@ class Instrument:
43
44
 
44
45
  def configurate(self, **args):
45
46
  """Override in subclasses."""
47
+ pass
46
48
 
47
49
  @property
48
50
  def slug_attr(self) -> str:
@@ -53,9 +55,7 @@ class Instrument:
53
55
  """Set up entity if supported."""
54
56
  self.vehicle = vehicle
55
57
  if not self.is_supported:
56
- _LOGGER.debug(
57
- "%s (%s:%s) is not supported", self, type(self).__name__, self.attr
58
- )
58
+ _LOGGER.debug("%s (%s:%s) is not supported", self, type(self).__name__, self.attr)
59
59
  return False
60
60
 
61
61
  _LOGGER.debug("%s is supported", self)
@@ -87,7 +87,8 @@ class Instrument:
87
87
  """Return current state."""
88
88
  if hasattr(self.vehicle, self.attr):
89
89
  return getattr(self.vehicle, self.attr)
90
- _LOGGER.debug('Could not find attribute "%s"', self.attr)
90
+ else:
91
+ _LOGGER.debug(f'Could not find attribute "{self.attr}"')
91
92
  return self.vehicle.get_attr(self.attr)
92
93
 
93
94
  @property
@@ -101,20 +102,16 @@ class Instrument:
101
102
  supported = "is_" + self.attr + "_supported"
102
103
  if hasattr(self.vehicle, supported):
103
104
  return getattr(self.vehicle, supported)
104
- return False
105
+ else:
106
+ return False
105
107
 
106
108
  @property
107
109
  def last_refresh(self) -> datetime | None:
108
- """Return last_updated attribute."""
109
110
  if hasattr(self.vehicle, self.attr + "_last_updated"):
110
111
  return getattr(self.vehicle, self.attr + "_last_updated")
111
- _LOGGER.warning(
112
- "Implement in subclasses. %s:%s_last_updated", self.__class__, self.attr
113
- )
112
+ _LOGGER.warning(f"Implement in subclasses. {self.__class__}:{self.attr}_last_updated")
114
113
  if self.state_class is not None:
115
- raise NotImplementedError(
116
- f"Implement in subclasses. {self.__class__}:{self.attr}_last_updated"
117
- )
114
+ raise NotImplementedError(f"Implement in subclasses. {self.__class__}:{self.attr}_last_updated")
118
115
  return None
119
116
 
120
117
 
@@ -130,7 +127,7 @@ class Sensor(Instrument):
130
127
  entity_type: str | None = None,
131
128
  device_class: str | None = None,
132
129
  state_class: str | None = None,
133
- ) -> None:
130
+ ):
134
131
  """Init."""
135
132
  super().__init__(
136
133
  component="sensor",
@@ -145,90 +142,72 @@ class Sensor(Instrument):
145
142
  self.convert = False
146
143
 
147
144
  def configurate(self, miles=False, scandinavian_miles=False, **config):
148
- """Configure unit conversion."""
149
145
  if self.unit and miles:
150
- if self.unit == "km":
146
+ if "km" == self.unit:
151
147
  self.unit = "mi"
152
148
  self.convert = True
153
- elif self.unit == "km/h":
149
+ elif "km/h" == self.unit:
154
150
  self.unit = "mi/h"
155
151
  self.convert = True
156
- elif self.unit == "l/100 km":
152
+ elif "l/100 km" == self.unit:
157
153
  self.unit = "l/100 mi"
158
154
  self.convert = True
159
- elif self.unit == "kWh/100 km":
155
+ elif "kWh/100 km" == self.unit:
160
156
  self.unit = "kWh/100 mi"
161
157
  self.convert = True
162
158
  elif self.unit and scandinavian_miles:
163
- if self.unit == "km":
159
+ if "km" == self.unit:
164
160
  self.unit = "mil"
165
- elif self.unit == "km/h":
161
+ elif "km/h" == self.unit:
166
162
  self.unit = "mil/h"
167
- elif self.unit == "l/100 km":
163
+ elif "l/100 km" == self.unit:
168
164
  self.unit = "l/100 mil"
169
- elif self.unit == "kWh/100 km":
165
+ elif "kWh/100 km" == self.unit:
170
166
  self.unit = "kWh/100 mil"
171
167
 
172
168
  @property
173
169
  def is_mutable(self):
174
- """Return boolean is_mutable."""
175
170
  return False
176
171
 
177
172
  @property
178
173
  def str_state(self):
179
- """Return current state as string."""
180
174
  if self.unit:
181
175
  return f"{self.state} {self.unit}"
182
- return f"{self.state}"
176
+ else:
177
+ return f"{self.state}"
183
178
 
184
179
  @property
185
180
  def state(self):
186
- """Return current state."""
187
- # Base value
188
181
  val = super().state
189
- # If the base value is not valid or convert is not true, return the original value
190
- if not val or not self.convert:
182
+ if val and self.unit and "mi" in self.unit and self.convert is True:
183
+ return round(int(val) * 0.6213712)
184
+ elif val and self.unit and "mi/h" in self.unit and self.convert is True:
185
+ return round(int(val) * 0.6213712)
186
+ elif val and self.unit and "gal/100 mi" in self.unit and self.convert is True:
187
+ return round(val * 0.4251438, 1)
188
+ elif val and self.unit and "kWh/100 mi" in self.unit and self.convert is True:
189
+ return round(val * 0.4251438, 1)
190
+ elif val and self.unit and "°F" in self.unit and self.convert is True:
191
+ temp = round((val * 9 / 5) + 32, 1)
192
+ return temp
193
+ elif val and self.unit in ["mil", "mil/h"]:
194
+ return val / 10
195
+ else:
191
196
  return val
192
- # Simplified condition checking
193
- if self.unit:
194
- if "mi" in self.unit:
195
- if self.unit in ["mi", "mi/h"]:
196
- return round(int(val) * 0.6213712)
197
- if "gal/100 mi" in self.unit or "kWh/100 mi" in self.unit:
198
- return round(val * 0.4251438, 1)
199
- if "°F" in self.unit:
200
- return round((val * 9 / 5) + 32, 1)
201
- if self.unit in ["mil", "mil/h"]:
202
- return val / 10
203
- # Default case, return the unmodified value
204
- return val
205
197
 
206
198
 
207
199
  class BinarySensor(Instrument):
208
- """BinarySensor instrument."""
209
-
210
- def __init__(
211
- self, attr, name, device_class, icon="", entity_type=None, reverse_state=False
212
- ) -> None:
213
- """Init."""
214
- super().__init__(
215
- component="binary_sensor",
216
- attr=attr,
217
- name=name,
218
- icon=icon,
219
- entity_type=entity_type,
220
- )
200
+ def __init__(self, attr, name, device_class, icon="", entity_type=None, reverse_state=False):
201
+ super().__init__(component="binary_sensor", attr=attr, name=name, icon=icon, entity_type=entity_type)
221
202
  self.device_class = device_class
222
203
  self.reverse_state = reverse_state
223
204
 
224
205
  @property
225
206
  def is_mutable(self):
226
- """Return boolean is_mutable."""
227
207
  return False
228
208
 
229
209
  @property
230
210
  def str_state(self):
231
- """Return current state as string."""
232
211
  if self.device_class in [VWDeviceClass.DOOR, VWDeviceClass.WINDOW]:
233
212
  return "Open" if self.state else "Closed"
234
213
  if self.device_class == VWDeviceClass.LOCK:
@@ -244,53 +223,47 @@ class BinarySensor(Instrument):
244
223
 
245
224
  @property
246
225
  def state(self):
247
- """Return current state."""
248
226
  val = super().state
249
227
 
250
228
  if isinstance(val, (bool, list)):
251
229
  if self.reverse_state:
252
230
  if bool(val):
253
231
  return False
254
- return True
255
- return bool(val)
256
- if isinstance(val, str):
232
+ else:
233
+ return True
234
+ else:
235
+ return bool(val)
236
+ elif isinstance(val, str):
257
237
  return val != "Normal"
258
238
  return val
259
239
 
260
240
  @property
261
241
  def is_on(self):
262
- """Return state."""
263
242
  return self.state
264
243
 
265
244
 
266
245
  class Switch(Instrument):
267
246
  """Switch instrument."""
268
247
 
269
- def __init__(self, attr, name, icon, entity_type=None) -> None:
270
- """Init."""
271
- super().__init__(
272
- component="switch", attr=attr, name=name, icon=icon, entity_type=entity_type
273
- )
248
+ def __init__(self, attr, name, icon, entity_type=None):
249
+ super().__init__(component="switch", attr=attr, name=name, icon=icon, entity_type=entity_type)
274
250
 
275
251
  @property
276
252
  def is_mutable(self):
277
- """Return boolean is_mutable."""
278
253
  return True
279
254
 
280
255
  @property
281
256
  def str_state(self):
282
- """Return current state as string."""
283
257
  return "On" if self.state else "Off"
284
258
 
285
259
  def is_on(self):
286
- """Return state."""
287
260
  return self.state
288
261
 
289
262
  def turn_on(self):
290
- """Turn on."""
263
+ pass
291
264
 
292
265
  def turn_off(self):
293
- """Turn off."""
266
+ pass
294
267
 
295
268
  @property
296
269
  def assumed_state(self) -> bool:
@@ -299,8 +272,6 @@ class Switch(Instrument):
299
272
 
300
273
 
301
274
  class Number(Instrument):
302
- """Number instrument."""
303
-
304
275
  def __init__(
305
276
  self,
306
277
  attr: str,
@@ -310,7 +281,7 @@ class Number(Instrument):
310
281
  entity_type: str | None = None,
311
282
  device_class: str | None = None,
312
283
  state_class: str | None = None,
313
- ) -> None:
284
+ ):
314
285
  """Init."""
315
286
  super().__init__(
316
287
  component="number",
@@ -325,45 +296,35 @@ class Number(Instrument):
325
296
 
326
297
  @property
327
298
  def is_mutable(self):
328
- """Return boolean is_mutable."""
329
299
  return False
330
300
 
331
301
  @property
332
302
  def state(self):
333
- """Return current state."""
334
303
  raise NotImplementedError
335
304
 
336
305
  @property
337
306
  def min_value(self):
338
- """Return min value."""
339
307
  raise NotImplementedError
340
308
 
341
309
  @property
342
310
  def max_value(self):
343
- """Return max value."""
344
311
  raise NotImplementedError
345
312
 
346
313
  @property
347
314
  def native_step(self):
348
- """Return native step."""
349
315
  raise NotImplementedError
350
316
 
351
317
 
352
318
  class Position(Instrument):
353
- """Position instrument."""
354
-
355
- def __init__(self) -> None:
356
- """Init."""
319
+ def __init__(self):
357
320
  super().__init__(component="device_tracker", attr="position", name="Position")
358
321
 
359
322
  @property
360
323
  def is_mutable(self):
361
- """Return boolean is_mutable."""
362
324
  return False
363
325
 
364
326
  @property
365
327
  def state(self):
366
- """Return current state."""
367
328
  state = super().state # or {}
368
329
  return (
369
330
  state.get("lat", "?"),
@@ -373,7 +334,6 @@ class Position(Instrument):
373
334
 
374
335
  @property
375
336
  def str_state(self):
376
- """Return current state as string."""
377
337
  state = super().state # or {}
378
338
  ts = state.get("timestamp", None)
379
339
  return (
@@ -384,106 +344,81 @@ class Position(Instrument):
384
344
 
385
345
 
386
346
  class DoorLock(Instrument):
387
- """DoorLock instrument."""
388
-
389
- def __init__(self) -> None:
390
- """Init."""
391
- super().__init__(
392
- component=VWDeviceClass.LOCK, attr="door_locked", name="Door locked"
393
- )
347
+ def __init__(self):
348
+ super().__init__(component=VWDeviceClass.LOCK, attr="door_locked", name="Door locked")
394
349
  self.spin = ""
395
350
 
396
351
  def configurate(self, **config):
397
- """Configure spin."""
398
352
  self.spin = config.get("spin", "")
399
353
 
400
354
  @property
401
355
  def is_mutable(self):
402
- """Return boolean is_mutable."""
403
356
  return True
404
357
 
405
358
  @property
406
359
  def str_state(self):
407
- """Return current state as string."""
408
360
  return "Locked" if self.state else "Unlocked"
409
361
 
410
362
  @property
411
363
  def state(self):
412
- """Return current state."""
413
364
  return self.vehicle.door_locked
414
365
 
415
366
  @property
416
367
  def is_locked(self):
417
- """Return current state."""
418
368
  return self.state
419
369
 
420
370
  async def lock(self):
421
- """Trigger Lock."""
422
371
  try:
423
372
  response = await self.vehicle.set_lock(VWDeviceClass.LOCK, self.spin)
424
373
  await self.vehicle.update()
425
374
  if self.callback is not None:
426
375
  self.callback()
427
- except Exception as e: # pylint: disable=broad-exception-caught
428
- _LOGGER.error("Lock failed: %s", e.args[0])
429
- return False
430
- else:
431
376
  return response
377
+ except Exception as e:
378
+ _LOGGER.error("Lock failed: %", e.args[0])
379
+ return False
432
380
 
433
381
  async def unlock(self):
434
- """Trigger Unlock."""
435
382
  try:
436
383
  response = await self.vehicle.set_lock("unlock", self.spin)
437
384
  await self.vehicle.update()
438
385
  if self.callback is not None:
439
386
  self.callback()
440
- except Exception as e: # pylint: disable=broad-exception-caught
441
- _LOGGER.error("Unlock failed: %s", e.args[0])
442
- return False
443
- else:
444
387
  return response
388
+ except Exception as e:
389
+ _LOGGER.error("Unlock failed: %", e.args[0])
390
+ return False
445
391
 
446
392
  @property
447
393
  def attributes(self) -> dict:
448
394
  """Return attributes."""
449
- return {"last_result": self.vehicle.lock_action_status}
395
+ return dict(last_result=self.vehicle.lock_action_status)
450
396
 
451
397
 
452
398
  class TrunkLock(Instrument):
453
- """TrunkLock instrument."""
454
-
455
- def __init__(self) -> None:
456
- """Init."""
457
- super().__init__(
458
- component=VWDeviceClass.LOCK, attr="trunk_locked", name="Trunk locked"
459
- )
399
+ def __init__(self):
400
+ super().__init__(component=VWDeviceClass.LOCK, attr="trunk_locked", name="Trunk locked")
460
401
 
461
402
  @property
462
403
  def is_mutable(self):
463
- """Return boolean is_mutable."""
464
404
  return True
465
405
 
466
406
  @property
467
407
  def str_state(self):
468
- """Return current state as string."""
469
408
  return "Locked" if self.state else "Unlocked"
470
409
 
471
410
  @property
472
411
  def state(self):
473
- """Return current state."""
474
412
  return self.vehicle.trunk_locked
475
413
 
476
414
  @property
477
415
  def is_locked(self):
478
- """Return current state."""
479
416
  return self.state
480
417
 
481
418
  async def lock(self):
482
- """Trigger lock."""
483
419
  return None
484
420
 
485
421
  async def unlock(self):
486
- """Trigger unlock."""
487
422
  return None
488
423
 
489
424
 
@@ -493,8 +428,7 @@ class TrunkLock(Instrument):
493
428
  class AuxiliaryDuration(Number):
494
429
  """Currently disabled due to the lack of auxiliary settings API."""
495
430
 
496
- def __init__(self) -> None:
497
- """Init."""
431
+ def __init__(self):
498
432
  super().__init__(
499
433
  attr="auxiliary_duration",
500
434
  name="Auxiliary duration",
@@ -505,45 +439,37 @@ class AuxiliaryDuration(Number):
505
439
  self.spin = ""
506
440
 
507
441
  def configurate(self, **config):
508
- """Configure spin."""
509
442
  self.spin = config.get("spin", "")
510
443
 
511
444
  @property
512
445
  def state(self):
513
- """Return current state."""
514
446
  return self.vehicle.auxiliary_duration
515
447
 
516
448
  async def set_value(self, minutes: int):
517
- """Set value."""
518
449
  await self.vehicle.set_auxiliary_duration(minutes, self.spin)
519
450
  await self.vehicle.update()
520
451
 
521
452
  @property
522
453
  def min_value(self):
523
- """Return min value."""
524
454
  return 5
525
455
 
526
456
  @property
527
457
  def max_value(self):
528
- """Return max value."""
529
458
  return 30
530
459
 
531
460
  @property
532
461
  def native_step(self):
533
- """Return native step."""
534
462
  return 5
535
463
 
536
464
  @property
537
465
  def attributes(self) -> dict:
538
466
  """Return attributes."""
539
- return {"last_result": self.vehicle.climater_action_status}
467
+ return dict(last_result=self.vehicle.climater_action_status)
540
468
 
541
469
 
542
470
  class BatteryTargetSOC(Number):
543
- """Battery target charge level."""
544
471
 
545
- def __init__(self) -> None:
546
- """Init."""
472
+ def __init__(self):
547
473
  super().__init__(
548
474
  attr="battery_target_charge_level",
549
475
  name="Battery target charge level",
@@ -554,42 +480,33 @@ class BatteryTargetSOC(Number):
554
480
 
555
481
  @property
556
482
  def state(self):
557
- """Return current state."""
558
483
  return self.vehicle.battery_target_charge_level
559
484
 
560
485
  async def set_value(self, value: int):
561
- """Set value."""
562
- await self.vehicle.set_charging_settings(
563
- setting="battery_target_charge_level", value=value
564
- )
486
+ await self.vehicle.set_charging_settings(setting="battery_target_charge_level", value=value)
565
487
  await self.vehicle.update()
566
488
 
567
489
  @property
568
490
  def min_value(self):
569
- """Return min value."""
570
491
  return 50
571
492
 
572
493
  @property
573
494
  def max_value(self):
574
- """Return max value."""
575
495
  return 100
576
496
 
577
497
  @property
578
498
  def native_step(self):
579
- """Return native step."""
580
499
  return 10
581
500
 
582
501
  @property
583
502
  def attributes(self) -> dict:
584
503
  """Return attributes."""
585
- return {"last_result": self.vehicle.charger_action_status}
504
+ return dict(last_result=self.vehicle.charger_action_status)
586
505
 
587
506
 
588
507
  class ClimatisationTargetTemperature(Number):
589
- """Climatisation target temperature."""
590
508
 
591
- def __init__(self) -> None:
592
- """Init."""
509
+ def __init__(self):
593
510
  super().__init__(
594
511
  attr="climatisation_target_temperature",
595
512
  name="Climatisation target temperature",
@@ -600,63 +517,49 @@ class ClimatisationTargetTemperature(Number):
600
517
 
601
518
  @property
602
519
  def state(self):
603
- """Return current state."""
604
520
  return self.vehicle.climatisation_target_temperature
605
521
 
606
522
  async def set_value(self, value: float):
607
- """Set value."""
608
- await self.vehicle.set_climatisation_settings(
609
- setting="climatisation_target_temperature", value=value
610
- )
523
+ await self.vehicle.set_climatisation_settings(setting="climatisation_target_temperature", value=value)
611
524
  await self.vehicle.update()
612
525
 
613
526
  @property
614
527
  def min_value(self):
615
- """Return min value."""
616
528
  return 15.5
617
529
 
618
530
  @property
619
531
  def max_value(self):
620
- """Return max value."""
621
532
  return 30
622
533
 
623
534
  @property
624
535
  def native_step(self):
625
- """Return native step."""
626
536
  return 0.5
627
537
 
628
538
  @property
629
539
  def attributes(self) -> dict:
630
540
  """Return attributes."""
631
- return {"last_result": self.vehicle.climater_action_status}
541
+ return dict(last_result=self.vehicle.climater_action_status)
632
542
 
633
543
 
634
544
  # Switches
635
545
 
636
546
 
637
547
  class RequestUpdate(Switch):
638
- """Force data refresh."""
639
-
640
- def __init__(self) -> None:
641
- """Init."""
642
- super().__init__(
643
- attr="refresh_data", name="Force data refresh", icon="mdi:car-connected"
644
- )
548
+ def __init__(self):
549
+ super().__init__(attr="refresh_data", name="Force data refresh", icon="mdi:car-connected")
645
550
 
646
551
  @property
647
552
  def state(self):
648
- """Return current state."""
649
553
  return self.vehicle.refresh_data
650
554
 
651
555
  async def turn_on(self):
652
- """Turn on."""
653
556
  await self.vehicle.set_refresh()
654
557
  await self.vehicle.update()
655
558
  if self.callback is not None:
656
559
  self.callback()
657
560
 
658
561
  async def turn_off(self):
659
- """Turn off."""
562
+ pass
660
563
 
661
564
  @property
662
565
  def assumed_state(self) -> bool:
@@ -666,32 +569,22 @@ class RequestUpdate(Switch):
666
569
  @property
667
570
  def attributes(self) -> dict:
668
571
  """Return attributes."""
669
- return {"last_result": self.vehicle.refresh_action_status}
572
+ return dict(last_result=self.vehicle.refresh_action_status)
670
573
 
671
574
 
672
575
  class ElectricClimatisation(Switch):
673
- """Electric Climatisation."""
674
-
675
- def __init__(self) -> None:
676
- """Init."""
677
- super().__init__(
678
- attr="electric_climatisation",
679
- name="Electric Climatisation",
680
- icon="mdi:air-conditioner",
681
- )
576
+ def __init__(self):
577
+ super().__init__(attr="electric_climatisation", name="Electric Climatisation", icon="mdi:air-conditioner")
682
578
 
683
579
  @property
684
580
  def state(self):
685
- """Return current state."""
686
581
  return self.vehicle.electric_climatisation
687
582
 
688
583
  async def turn_on(self):
689
- """Turn on."""
690
584
  await self.vehicle.set_climatisation("start")
691
585
  await self.vehicle.update()
692
586
 
693
587
  async def turn_off(self):
694
- """Turn off."""
695
588
  await self.vehicle.set_climatisation("stop")
696
589
  await self.vehicle.update()
697
590
 
@@ -703,37 +596,26 @@ class ElectricClimatisation(Switch):
703
596
  @property
704
597
  def attributes(self) -> dict:
705
598
  """Return attributes."""
706
- return {"last_result": self.vehicle.climater_action_status}
599
+ return dict(last_result=self.vehicle.climater_action_status)
707
600
 
708
601
 
709
602
  class AuxiliaryClimatisation(Switch):
710
- """Auxiliary Climatisation."""
711
-
712
- def __init__(self) -> None:
713
- """Init."""
714
- super().__init__(
715
- attr="auxiliary_climatisation",
716
- name="Auxiliary Climatisation",
717
- icon="mdi:radiator",
718
- )
603
+ def __init__(self):
604
+ super().__init__(attr="auxiliary_climatisation", name="Auxiliary Climatisation", icon="mdi:radiator")
719
605
  self.spin = ""
720
606
 
721
607
  def configurate(self, **config):
722
- """Configure spin."""
723
608
  self.spin = config.get("spin", "")
724
609
 
725
610
  @property
726
611
  def state(self):
727
- """Return current state."""
728
612
  return self.vehicle.auxiliary_climatisation
729
613
 
730
614
  async def turn_on(self):
731
- """Turn on."""
732
615
  await self.vehicle.set_auxiliary_climatisation("start", self.spin)
733
616
  await self.vehicle.update()
734
617
 
735
618
  async def turn_off(self):
736
- """Turn off."""
737
619
  await self.vehicle.set_auxiliary_climatisation("stop", self.spin)
738
620
  await self.vehicle.update()
739
621
 
@@ -745,28 +627,22 @@ class AuxiliaryClimatisation(Switch):
745
627
  @property
746
628
  def attributes(self) -> dict:
747
629
  """Return attributes."""
748
- return {"last_result": self.vehicle.climater_action_status}
630
+ return dict(last_result=self.vehicle.climater_action_status)
749
631
 
750
632
 
751
633
  class Charging(Switch):
752
- """Charging."""
753
-
754
- def __init__(self) -> None:
755
- """Init."""
634
+ def __init__(self):
756
635
  super().__init__(attr="charging", name="Charging", icon="mdi:battery")
757
636
 
758
637
  @property
759
638
  def state(self):
760
- """Return current state."""
761
639
  return self.vehicle.charging
762
640
 
763
641
  async def turn_on(self):
764
- """Turn on."""
765
642
  await self.vehicle.set_charger("start")
766
643
  await self.vehicle.update()
767
644
 
768
645
  async def turn_off(self):
769
- """Turn off."""
770
646
  await self.vehicle.set_charger("stop")
771
647
  await self.vehicle.update()
772
648
 
@@ -778,38 +654,25 @@ class Charging(Switch):
778
654
  @property
779
655
  def attributes(self) -> dict:
780
656
  """Return attributes."""
781
- return {"last_result": self.vehicle.charger_action_status}
657
+ return dict(last_result=self.vehicle.charger_action_status)
782
658
 
783
659
 
784
660
  class ReducedACCharging(Switch):
785
- """Reduced AC Charging."""
786
-
787
- def __init__(self) -> None:
788
- """Init."""
661
+ def __init__(self):
789
662
  super().__init__(
790
- attr="reduced_ac_charging",
791
- name="Reduced AC Charging",
792
- icon="mdi:ev-station",
793
- entity_type="config",
663
+ attr="reduced_ac_charging", name="Reduced AC Charging", icon="mdi:ev-station", entity_type="config"
794
664
  )
795
665
 
796
666
  @property
797
667
  def state(self):
798
- """Return current state."""
799
668
  return self.vehicle.reduced_ac_charging
800
669
 
801
670
  async def turn_on(self):
802
- """Turn on."""
803
- await self.vehicle.set_charging_settings(
804
- setting="reduced_ac_charging", value="reduced"
805
- )
671
+ await self.vehicle.set_charging_settings(setting="reduced_ac_charging", value="reduced")
806
672
  await self.vehicle.update()
807
673
 
808
674
  async def turn_off(self):
809
- """Turn off."""
810
- await self.vehicle.set_charging_settings(
811
- setting="reduced_ac_charging", value="maximum"
812
- )
675
+ await self.vehicle.set_charging_settings(setting="reduced_ac_charging", value="maximum")
813
676
  await self.vehicle.update()
814
677
 
815
678
  @property
@@ -820,14 +683,11 @@ class ReducedACCharging(Switch):
820
683
  @property
821
684
  def attributes(self) -> dict:
822
685
  """Return attributes."""
823
- return {"last_result": self.vehicle.charger_action_status}
686
+ return dict(last_result=self.vehicle.charger_action_status)
824
687
 
825
688
 
826
689
  class AutoReleaseACConnector(Switch):
827
- """Auto-release AC connector."""
828
-
829
- def __init__(self) -> None:
830
- """Init."""
690
+ def __init__(self):
831
691
  super().__init__(
832
692
  attr="auto_release_ac_connector",
833
693
  name="Auto-release AC connector",
@@ -837,21 +697,14 @@ class AutoReleaseACConnector(Switch):
837
697
 
838
698
  @property
839
699
  def state(self):
840
- """Return current state."""
841
700
  return self.vehicle.auto_release_ac_connector
842
701
 
843
702
  async def turn_on(self):
844
- """Turn on."""
845
- await self.vehicle.set_charging_settings(
846
- setting="auto_release_ac_connector", value="permanent"
847
- )
703
+ await self.vehicle.set_charging_settings(setting="auto_release_ac_connector", value="permanent")
848
704
  await self.vehicle.update()
849
705
 
850
706
  async def turn_off(self):
851
- """Turn off."""
852
- await self.vehicle.set_charging_settings(
853
- setting="auto_release_ac_connector", value="off"
854
- )
707
+ await self.vehicle.set_charging_settings(setting="auto_release_ac_connector", value="off")
855
708
  await self.vehicle.update()
856
709
 
857
710
  @property
@@ -861,10 +714,7 @@ class AutoReleaseACConnector(Switch):
861
714
 
862
715
 
863
716
  class BatteryCareMode(Switch):
864
- """Battery care mode."""
865
-
866
- def __init__(self) -> None:
867
- """Init."""
717
+ def __init__(self):
868
718
  super().__init__(
869
719
  attr="battery_care_mode",
870
720
  name="Battery care mode",
@@ -874,16 +724,13 @@ class BatteryCareMode(Switch):
874
724
 
875
725
  @property
876
726
  def state(self):
877
- """Return current state."""
878
727
  return self.vehicle.battery_care_mode
879
728
 
880
729
  async def turn_on(self):
881
- """Turn on."""
882
730
  await self.vehicle.set_charging_care_settings(value="activated")
883
731
  await self.vehicle.update()
884
732
 
885
733
  async def turn_off(self):
886
- """Turn off."""
887
734
  await self.vehicle.set_charging_care_settings(value="deactivated")
888
735
  await self.vehicle.update()
889
736
 
@@ -895,14 +742,11 @@ class BatteryCareMode(Switch):
895
742
  @property
896
743
  def attributes(self) -> dict:
897
744
  """Return attributes."""
898
- return {"last_result": self.vehicle.charger_action_status}
745
+ return dict(last_result=self.vehicle.charger_action_status)
899
746
 
900
747
 
901
748
  class OptimisedBatteryUse(Switch):
902
- """Optimised battery use."""
903
-
904
- def __init__(self) -> None:
905
- """Init."""
749
+ def __init__(self):
906
750
  super().__init__(
907
751
  attr="optimised_battery_use",
908
752
  name="Optimised battery use",
@@ -912,16 +756,13 @@ class OptimisedBatteryUse(Switch):
912
756
 
913
757
  @property
914
758
  def state(self):
915
- """Return current state."""
916
759
  return self.vehicle.optimised_battery_use
917
760
 
918
761
  async def turn_on(self):
919
- """Turn on."""
920
762
  await self.vehicle.set_readiness_battery_support(value=True)
921
763
  await self.vehicle.update()
922
764
 
923
765
  async def turn_off(self):
924
- """Turn off."""
925
766
  await self.vehicle.set_readiness_battery_support(value=False)
926
767
  await self.vehicle.update()
927
768
 
@@ -933,25 +774,20 @@ class OptimisedBatteryUse(Switch):
933
774
  @property
934
775
  def attributes(self) -> dict:
935
776
  """Return attributes."""
936
- return {"last_result": self.vehicle.charger_action_status}
777
+ return dict(last_result=self.vehicle.charger_action_status)
937
778
 
938
779
 
939
780
  class DepartureTimer(Switch):
940
781
  """Departure timers."""
941
782
 
942
- def __init__(self, id: str | int) -> None:
943
- """Init."""
783
+ def __init__(self, id: str | int):
944
784
  self._id = id
945
785
  super().__init__(
946
- attr=f"departure_timer{id}",
947
- name=f"Departure Timer {id}",
948
- icon="mdi:car-clock",
949
- entity_type="config",
786
+ attr=f"departure_timer{id}", name=f"Departure Timer {id}", icon="mdi:car-clock", entity_type="config"
950
787
  )
951
788
  self.spin = ""
952
789
 
953
790
  def configurate(self, **config):
954
- """Configure spin."""
955
791
  self.spin = config.get("spin", "")
956
792
 
957
793
  @property
@@ -961,16 +797,12 @@ class DepartureTimer(Switch):
961
797
 
962
798
  async def turn_on(self):
963
799
  """Enable timer."""
964
- await self.vehicle.set_departure_timer(
965
- timer_id=self._id, spin=self.spin, enable=True
966
- )
800
+ await self.vehicle.set_departure_timer(timer_id=self._id, spin=self.spin, enable=True)
967
801
  await self.vehicle.update()
968
802
 
969
803
  async def turn_off(self):
970
804
  """Disable timer."""
971
- await self.vehicle.set_departure_timer(
972
- timer_id=self._id, spin=self.spin, enable=False
973
- )
805
+ await self.vehicle.set_departure_timer(timer_id=self._id, spin=self.spin, enable=False)
974
806
  await self.vehicle.update()
975
807
 
976
808
  @property
@@ -988,19 +820,15 @@ class DepartureTimer(Switch):
988
820
  class ACDepartureTimer(Switch):
989
821
  """Air conditioning departure timers."""
990
822
 
991
- def __init__(self, id: str | int) -> None:
992
- """Init."""
823
+ def __init__(self, id: str | int):
993
824
  self._id = id
994
825
  super().__init__(
995
- attr=f"ac_departure_timer{id}",
996
- name=f"AC Departure Timer {id}",
997
- icon="mdi:fan-clock",
998
- entity_type="config",
826
+ attr=f"ac_departure_timer{id}", name=f"AC Departure Timer {id}", icon="mdi:fan-clock", entity_type="config"
999
827
  )
1000
828
 
1001
829
  @property
1002
830
  def state(self):
1003
- """Return current state."""
831
+ """Return switch state."""
1004
832
  return self.vehicle.ac_departure_timer_enabled(self._id)
1005
833
 
1006
834
  async def turn_on(self):
@@ -1026,26 +854,18 @@ class ACDepartureTimer(Switch):
1026
854
 
1027
855
 
1028
856
  class WindowHeater(Switch):
1029
- """Window Heater."""
1030
-
1031
- def __init__(self) -> None:
1032
- """Init."""
1033
- super().__init__(
1034
- attr="window_heater", name="Window Heater", icon="mdi:car-defrost-rear"
1035
- )
857
+ def __init__(self):
858
+ super().__init__(attr="window_heater", name="Window Heater", icon="mdi:car-defrost-rear")
1036
859
 
1037
860
  @property
1038
861
  def state(self):
1039
- """Return current state."""
1040
862
  return self.vehicle.window_heater
1041
863
 
1042
864
  async def turn_on(self):
1043
- """Turn on."""
1044
865
  await self.vehicle.set_window_heating("start")
1045
866
  await self.vehicle.update()
1046
867
 
1047
868
  async def turn_off(self):
1048
- """Turn off."""
1049
869
  await self.vehicle.set_window_heating("stop")
1050
870
  await self.vehicle.update()
1051
871
 
@@ -1057,14 +877,11 @@ class WindowHeater(Switch):
1057
877
  @property
1058
878
  def attributes(self) -> dict:
1059
879
  """Return attributes."""
1060
- return {"last_result": self.vehicle.climater_action_status}
880
+ return dict(last_result=self.vehicle.climater_action_status)
1061
881
 
1062
882
 
1063
883
  class BatteryClimatisation(Switch):
1064
- """Climatisation from battery."""
1065
-
1066
- def __init__(self) -> None:
1067
- """Init."""
884
+ def __init__(self):
1068
885
  super().__init__(
1069
886
  attr="climatisation_without_external_power",
1070
887
  name="Climatisation from battery",
@@ -1074,21 +891,14 @@ class BatteryClimatisation(Switch):
1074
891
 
1075
892
  @property
1076
893
  def state(self):
1077
- """Return current state."""
1078
894
  return self.vehicle.climatisation_without_external_power
1079
895
 
1080
896
  async def turn_on(self):
1081
- """Turn on."""
1082
- await self.vehicle.set_climatisation_settings(
1083
- setting="climatisation_without_external_power", value=True
1084
- )
897
+ await self.vehicle.set_climatisation_settings(setting="climatisation_without_external_power", value=True)
1085
898
  await self.vehicle.update()
1086
899
 
1087
900
  async def turn_off(self):
1088
- """Turn off."""
1089
- await self.vehicle.set_climatisation_settings(
1090
- setting="climatisation_without_external_power", value=False
1091
- )
901
+ await self.vehicle.set_climatisation_settings(setting="climatisation_without_external_power", value=False)
1092
902
  await self.vehicle.update()
1093
903
 
1094
904
  @property
@@ -1099,14 +909,11 @@ class BatteryClimatisation(Switch):
1099
909
  @property
1100
910
  def attributes(self) -> dict:
1101
911
  """Return attributes."""
1102
- return {"last_result": self.vehicle.climater_action_status}
912
+ return dict(last_result=self.vehicle.climater_action_status)
1103
913
 
1104
914
 
1105
915
  class AuxiliaryAC(Switch):
1106
- """Auxiliary air conditioning."""
1107
-
1108
- def __init__(self) -> None:
1109
- """Init."""
916
+ def __init__(self):
1110
917
  super().__init__(
1111
918
  attr="auxiliary_air_conditioning",
1112
919
  name="Auxiliary air conditioning",
@@ -1116,21 +923,14 @@ class AuxiliaryAC(Switch):
1116
923
 
1117
924
  @property
1118
925
  def state(self):
1119
- """Return current state."""
1120
926
  return self.vehicle.auxiliary_air_conditioning
1121
927
 
1122
928
  async def turn_on(self):
1123
- """Turn on."""
1124
- await self.vehicle.set_climatisation_settings(
1125
- setting="auxiliary_air_conditioning", value=True
1126
- )
929
+ await self.vehicle.set_climatisation_settings(setting="auxiliary_air_conditioning", value=True)
1127
930
  await self.vehicle.update()
1128
931
 
1129
932
  async def turn_off(self):
1130
- """Turn off."""
1131
- await self.vehicle.set_climatisation_settings(
1132
- setting="auxiliary_air_conditioning", value=False
1133
- )
933
+ await self.vehicle.set_climatisation_settings(setting="auxiliary_air_conditioning", value=False)
1134
934
  await self.vehicle.update()
1135
935
 
1136
936
  @property
@@ -1141,14 +941,11 @@ class AuxiliaryAC(Switch):
1141
941
  @property
1142
942
  def attributes(self) -> dict:
1143
943
  """Return attributes."""
1144
- return {"last_result": self.vehicle.climater_action_status}
944
+ return dict(last_result=self.vehicle.climater_action_status)
1145
945
 
1146
946
 
1147
947
  class AutomaticWindowHeating(Switch):
1148
- """Automatic window heating."""
1149
-
1150
- def __init__(self) -> None:
1151
- """Init."""
948
+ def __init__(self):
1152
949
  super().__init__(
1153
950
  attr="automatic_window_heating",
1154
951
  name="Automatic window heating",
@@ -1158,21 +955,14 @@ class AutomaticWindowHeating(Switch):
1158
955
 
1159
956
  @property
1160
957
  def state(self):
1161
- """Return current state."""
1162
958
  return self.vehicle.automatic_window_heating
1163
959
 
1164
960
  async def turn_on(self):
1165
- """Turn on."""
1166
- await self.vehicle.set_climatisation_settings(
1167
- setting="automatic_window_heating", value=True
1168
- )
961
+ await self.vehicle.set_climatisation_settings(setting="automatic_window_heating", value=True)
1169
962
  await self.vehicle.update()
1170
963
 
1171
964
  async def turn_off(self):
1172
- """Turn off."""
1173
- await self.vehicle.set_climatisation_settings(
1174
- setting="automatic_window_heating", value=False
1175
- )
965
+ await self.vehicle.set_climatisation_settings(setting="automatic_window_heating", value=False)
1176
966
  await self.vehicle.update()
1177
967
 
1178
968
  @property
@@ -1183,14 +973,11 @@ class AutomaticWindowHeating(Switch):
1183
973
  @property
1184
974
  def attributes(self) -> dict:
1185
975
  """Return attributes."""
1186
- return {"last_result": self.vehicle.climater_action_status}
976
+ return dict(last_result=self.vehicle.climater_action_status)
1187
977
 
1188
978
 
1189
979
  class ZoneFrontLeft(Switch):
1190
- """Zone Front Left."""
1191
-
1192
- def __init__(self) -> None:
1193
- """Init."""
980
+ def __init__(self):
1194
981
  super().__init__(
1195
982
  attr="zone_front_left",
1196
983
  name="Zone Front Left",
@@ -1200,21 +987,14 @@ class ZoneFrontLeft(Switch):
1200
987
 
1201
988
  @property
1202
989
  def state(self):
1203
- """Return current state."""
1204
990
  return self.vehicle.zone_front_left
1205
991
 
1206
992
  async def turn_on(self):
1207
- """Turn on."""
1208
- await self.vehicle.set_climatisation_settings(
1209
- setting="zone_front_left", value=True
1210
- )
993
+ await self.vehicle.set_climatisation_settings(setting="zone_front_left", value=True)
1211
994
  await self.vehicle.update()
1212
995
 
1213
996
  async def turn_off(self):
1214
- """Turn off."""
1215
- await self.vehicle.set_climatisation_settings(
1216
- setting="zone_front_left", value=False
1217
- )
997
+ await self.vehicle.set_climatisation_settings(setting="zone_front_left", value=False)
1218
998
  await self.vehicle.update()
1219
999
 
1220
1000
  @property
@@ -1225,14 +1005,11 @@ class ZoneFrontLeft(Switch):
1225
1005
  @property
1226
1006
  def attributes(self) -> dict:
1227
1007
  """Return attributes."""
1228
- return {"last_result": self.vehicle.climater_action_status}
1008
+ return dict(last_result=self.vehicle.climater_action_status)
1229
1009
 
1230
1010
 
1231
1011
  class ZoneFrontRight(Switch):
1232
- """Zone Front Right."""
1233
-
1234
- def __init__(self) -> None:
1235
- """Init."""
1012
+ def __init__(self):
1236
1013
  super().__init__(
1237
1014
  attr="zone_front_right",
1238
1015
  name="Zone Front Right",
@@ -1242,21 +1019,14 @@ class ZoneFrontRight(Switch):
1242
1019
 
1243
1020
  @property
1244
1021
  def state(self):
1245
- """Return current state."""
1246
1022
  return self.vehicle.zone_front_right
1247
1023
 
1248
1024
  async def turn_on(self):
1249
- """Turn on."""
1250
- await self.vehicle.set_climatisation_settings(
1251
- setting="zone_front_right", value=True
1252
- )
1025
+ await self.vehicle.set_climatisation_settings(setting="zone_front_right", value=True)
1253
1026
  await self.vehicle.update()
1254
1027
 
1255
1028
  async def turn_off(self):
1256
- """Turn off."""
1257
- await self.vehicle.set_climatisation_settings(
1258
- setting="zone_front_right", value=False
1259
- )
1029
+ await self.vehicle.set_climatisation_settings(setting="zone_front_right", value=False)
1260
1030
  await self.vehicle.update()
1261
1031
 
1262
1032
  @property
@@ -1267,20 +1037,16 @@ class ZoneFrontRight(Switch):
1267
1037
  @property
1268
1038
  def attributes(self) -> dict:
1269
1039
  """Return attributes."""
1270
- return {"last_result": self.vehicle.climater_action_status}
1040
+ return dict(last_result=self.vehicle.climater_action_status)
1271
1041
 
1272
1042
 
1273
1043
  class RequestResults(Sensor):
1274
1044
  """Request results sensor class."""
1275
1045
 
1276
- def __init__(self) -> None:
1046
+ def __init__(self):
1277
1047
  """Init."""
1278
1048
  super().__init__(
1279
- attr="request_results",
1280
- name="Request results",
1281
- icon="mdi:chat-alert",
1282
- unit="",
1283
- entity_type="diag",
1049
+ attr="request_results", name="Request results", icon="mdi:chat-alert", unit="", entity_type="diag"
1284
1050
  )
1285
1051
 
1286
1052
  @property
@@ -1351,18 +1117,6 @@ def create_instruments():
1351
1117
  icon="mdi:battery-arrow-up",
1352
1118
  unit="%",
1353
1119
  ),
1354
- Sensor(
1355
- attr="hv_battery_min_temperature",
1356
- name="HV battery min temperature",
1357
- icon="mdi:thermometer-chevron-down",
1358
- unit=TEMP_CELSIUS,
1359
- ),
1360
- Sensor(
1361
- attr="hv_battery_max_temperature",
1362
- name="HV battery max temperature",
1363
- icon="mdi:thermometer-chevron-up",
1364
- unit=TEMP_CELSIUS,
1365
- ),
1366
1120
  Sensor(
1367
1121
  attr="adblue_level",
1368
1122
  name="Adblue level",
@@ -1375,12 +1129,6 @@ def create_instruments():
1375
1129
  icon="mdi:fuel",
1376
1130
  unit="%",
1377
1131
  ),
1378
- Sensor(
1379
- attr="gas_level",
1380
- name="Gas level",
1381
- icon="mdi:gas-cylinder",
1382
- unit="%",
1383
- ),
1384
1132
  Sensor(
1385
1133
  attr="service_inspection",
1386
1134
  name="Service inspection days",
@@ -1439,18 +1187,6 @@ def create_instruments():
1439
1187
  icon="mdi:car",
1440
1188
  unit="km",
1441
1189
  ),
1442
- Sensor(
1443
- attr="fuel_range",
1444
- name="Fuel range",
1445
- icon="mdi:car",
1446
- unit="km",
1447
- ),
1448
- Sensor(
1449
- attr="gas_range",
1450
- name="Gas range",
1451
- icon="mdi:car",
1452
- unit="km",
1453
- ),
1454
1190
  Sensor(
1455
1191
  attr="combined_range",
1456
1192
  name="Combined range",
@@ -1522,13 +1258,6 @@ def create_instruments():
1522
1258
  unit="l/100 km",
1523
1259
  state_class=VWStateClass.MEASUREMENT,
1524
1260
  ),
1525
- Sensor(
1526
- attr="trip_last_average_gas_consumption",
1527
- name="Last trip average gas consumption",
1528
- icon="mdi:gas-cylinder",
1529
- unit="m3/100km",
1530
- state_class=VWStateClass.MEASUREMENT,
1531
- ),
1532
1261
  Sensor(
1533
1262
  attr="trip_last_duration",
1534
1263
  name="Last trip duration",
@@ -1652,31 +1381,14 @@ def create_instruments():
1652
1381
  device_class=VWDeviceClass.TIMESTAMP,
1653
1382
  entity_type="diag",
1654
1383
  ),
1384
+ BinarySensor(attr="external_power", name="External power", device_class=VWDeviceClass.POWER),
1385
+ BinarySensor(attr="energy_flow", name="Energy flow", device_class=VWDeviceClass.POWER),
1655
1386
  BinarySensor(
1656
- attr="external_power",
1657
- name="External power",
1658
- device_class=VWDeviceClass.POWER,
1659
- ),
1660
- BinarySensor(
1661
- attr="energy_flow", name="Energy flow", device_class=VWDeviceClass.POWER
1662
- ),
1663
- BinarySensor(
1664
- attr="parking_light",
1665
- name="Parking light",
1666
- device_class=VWDeviceClass.LIGHT,
1667
- icon="mdi:car-parking-lights",
1668
- ),
1669
- BinarySensor(
1670
- attr="door_locked",
1671
- name="Doors locked",
1672
- device_class=VWDeviceClass.LOCK,
1673
- reverse_state=True,
1387
+ attr="parking_light", name="Parking light", device_class=VWDeviceClass.LIGHT, icon="mdi:car-parking-lights"
1674
1388
  ),
1389
+ BinarySensor(attr="door_locked", name="Doors locked", device_class=VWDeviceClass.LOCK, reverse_state=True),
1675
1390
  BinarySensor(
1676
- attr="door_locked_sensor",
1677
- name="Doors locked",
1678
- device_class=VWDeviceClass.LOCK,
1679
- reverse_state=True,
1391
+ attr="door_locked_sensor", name="Doors locked", device_class=VWDeviceClass.LOCK, reverse_state=True
1680
1392
  ),
1681
1393
  BinarySensor(
1682
1394
  attr="door_closed_left_front",
@@ -1706,30 +1418,12 @@ def create_instruments():
1706
1418
  reverse_state=True,
1707
1419
  icon="mdi:car-door",
1708
1420
  ),
1421
+ BinarySensor(attr="trunk_locked", name="Trunk locked", device_class=VWDeviceClass.LOCK, reverse_state=True),
1709
1422
  BinarySensor(
1710
- attr="trunk_locked",
1711
- name="Trunk locked",
1712
- device_class=VWDeviceClass.LOCK,
1713
- reverse_state=True,
1714
- ),
1715
- BinarySensor(
1716
- attr="trunk_locked_sensor",
1717
- name="Trunk locked",
1718
- device_class=VWDeviceClass.LOCK,
1719
- reverse_state=True,
1720
- ),
1721
- BinarySensor(
1722
- attr="trunk_closed",
1723
- name="Trunk closed",
1724
- device_class=VWDeviceClass.DOOR,
1725
- reverse_state=True,
1726
- ),
1727
- BinarySensor(
1728
- attr="hood_closed",
1729
- name="Hood closed",
1730
- device_class=VWDeviceClass.DOOR,
1731
- reverse_state=True,
1423
+ attr="trunk_locked_sensor", name="Trunk locked", device_class=VWDeviceClass.LOCK, reverse_state=True
1732
1424
  ),
1425
+ BinarySensor(attr="trunk_closed", name="Trunk closed", device_class=VWDeviceClass.DOOR, reverse_state=True),
1426
+ BinarySensor(attr="hood_closed", name="Hood closed", device_class=VWDeviceClass.DOOR, reverse_state=True),
1733
1427
  BinarySensor(
1734
1428
  attr="charging_cable_connected",
1735
1429
  name="Charging cable connected",
@@ -1743,10 +1437,7 @@ def create_instruments():
1743
1437
  reverse_state=True,
1744
1438
  ),
1745
1439
  BinarySensor(
1746
- attr="sunroof_closed",
1747
- name="Sunroof closed",
1748
- device_class=VWDeviceClass.WINDOW,
1749
- reverse_state=True,
1440
+ attr="sunroof_closed", name="Sunroof closed", device_class=VWDeviceClass.WINDOW, reverse_state=True
1750
1441
  ),
1751
1442
  BinarySensor(
1752
1443
  attr="sunroof_rear_closed",
@@ -1755,16 +1446,10 @@ def create_instruments():
1755
1446
  reverse_state=True,
1756
1447
  ),
1757
1448
  BinarySensor(
1758
- attr="roof_cover_closed",
1759
- name="Roof cover closed",
1760
- device_class=VWDeviceClass.WINDOW,
1761
- reverse_state=True,
1449
+ attr="roof_cover_closed", name="Roof cover closed", device_class=VWDeviceClass.WINDOW, reverse_state=True
1762
1450
  ),
1763
1451
  BinarySensor(
1764
- attr="windows_closed",
1765
- name="Windows closed",
1766
- device_class=VWDeviceClass.WINDOW,
1767
- reverse_state=True,
1452
+ attr="windows_closed", name="Windows closed", device_class=VWDeviceClass.WINDOW, reverse_state=True
1768
1453
  ),
1769
1454
  BinarySensor(
1770
1455
  attr="window_closed_left_front",
@@ -1790,11 +1475,7 @@ def create_instruments():
1790
1475
  device_class=VWDeviceClass.WINDOW,
1791
1476
  reverse_state=True,
1792
1477
  ),
1793
- BinarySensor(
1794
- attr="vehicle_moving",
1795
- name="Vehicle Moving",
1796
- device_class=VWDeviceClass.MOVING,
1797
- ),
1478
+ BinarySensor(attr="vehicle_moving", name="Vehicle Moving", device_class=VWDeviceClass.MOVING),
1798
1479
  BinarySensor(
1799
1480
  attr="request_in_progress",
1800
1481
  name="Request in progress",
@@ -1807,11 +1488,7 @@ def create_instruments():
1807
1488
  class Dashboard:
1808
1489
  """Helper for accessing the instruments."""
1809
1490
 
1810
- def __init__(self, vehicle, **config) -> None:
1491
+ def __init__(self, vehicle, **config):
1811
1492
  """Initialize instruments."""
1812
1493
  _LOGGER.debug("Setting up dashboard with config :%s", config)
1813
- self.instruments = [
1814
- instrument
1815
- for instrument in create_instruments()
1816
- if instrument.setup(vehicle, **config)
1817
- ]
1494
+ self.instruments = [instrument for instrument in create_instruments() if instrument.setup(vehicle, **config)]