Add state to CheckControlMessages in bmw_connected_drive (#75802)

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
pull/75807/head
rikroe 2022-07-27 10:01:09 +02:00 committed by GitHub
parent 5e6217f20c
commit 5687150786
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 8 deletions

View File

@ -39,14 +39,8 @@ def _condition_based_services(
def _check_control_messages(vehicle: MyBMWVehicle) -> dict[str, Any]:
extra_attributes: dict[str, Any] = {}
if vehicle.check_control_messages.has_check_control_messages:
cbs_list = [
message.description_short
for message in vehicle.check_control_messages.messages
]
extra_attributes["check_control_messages"] = cbs_list
else:
extra_attributes["check_control_messages"] = "OK"
for message in vehicle.check_control_messages.messages:
extra_attributes.update({message.description_short: message.state.value})
return extra_attributes