Add streaming to charge cable connected in Teslemetry (#145880)

This commit is contained in:
Brett Adams 2025-06-01 04:01:10 +10:00 committed by GitHub
parent cabf7860b3
commit ddef6fdb98
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -125,6 +125,9 @@ VEHICLE_DESCRIPTIONS: tuple[TeslemetryBinarySensorEntityDescription, ...] = (
key="charge_state_conn_charge_cable",
polling=True,
polling_value_fn=lambda x: x != "<invalid>",
streaming_listener=lambda vehicle, callback: vehicle.listen_ChargingCableType(
lambda value: callback(value != "Unknown")
),
entity_category=EntityCategory.DIAGNOSTIC,
device_class=BinarySensorDeviceClass.CONNECTIVITY,
),

View File

@ -673,7 +673,7 @@
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
'state': 'unknown',
})
# ---
# name: test_binary_sensor[binary_sensor.test_charge_enable_request-entry]
@ -3374,7 +3374,7 @@
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
'state': 'unknown',
})
# ---
# name: test_binary_sensor_refresh[binary_sensor.test_charge_enable_request-statealt]