format: code style

This commit is contained in:
LiShuzhen 2025-03-05 16:09:10 +08:00
parent 603594144f
commit e25a86eee7
3 changed files with 7 additions and 6 deletions

View File

@ -550,8 +550,9 @@ class MIoTDevice:
# Optional actions
# Optional events
miot_service.platform = platform
# entity_category:
if entity_category := SPEC_SERVICE_TRANS_MAP[service_name].get('entity_category'):
# entity_category
if entity_category := SPEC_SERVICE_TRANS_MAP[service_name].get(
'entity_category', None):
miot_service.entity_category = entity_category
return entity_data

View File

@ -465,7 +465,7 @@ class _MIoTSpecBase:
iid: int
type_: str
description: str
description_trans: str
description_trans: Optional[str]
proprietary: bool
need_filter: bool
name: str
@ -476,7 +476,7 @@ class _MIoTSpecBase:
device_class: Any
state_class: Any
external_unit: Any
entity_category: str | None
entity_category: Optional[str]
spec_id: int

View File

@ -332,7 +332,7 @@ SPEC_DEVICE_TRANS_MAP: dict = {
'actions': set<action instance name: str>
},
'entity': str,
'entity_category'?: str,
'entity_category'?: str
}
}
"""
@ -365,7 +365,7 @@ SPEC_SERVICE_TRANS_MAP: dict = {
}
},
'entity': 'light',
'entity_category': EntityCategory.CONFIG,
'entity_category': EntityCategory.CONFIG
},
'fan': {
'required': {