8000 Quirks v2 translation key unit tests missing from ZHA · Issue #72 · zigpy/zha · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
10000
Quirks v2 translation key unit tests missing from ZHA #72
Open
@puddly

Description

@puddly

This was moved to the library but is no longer present in Core, which is where translations actually live:

zha/tests/test_discover.py

Lines 828 to 847 in a62f188

def validate_translation_keys(
quirk: QuirksV2RegistryEntry,
entity_metadata: EntityMetadata,
platform: Platform,
translations: dict,
) -> None:
"""Ensure translation keys exist for all v2 quirks."""
if isinstance(entity_metadata, ZCLCommandButtonMetadata):
default_translation_key = entity_metadata.command_name
else:
default_translation_key = entity_metadata.attribute_name
translation_key = entity_metadata.translation_key or default_translation_key
if (
translation_key is not None
and translation_key not in translations["entity"][platform]
):
raise ValueError(
f"Missing translation key: {translation_key} for {platform.name} {quirk}"
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bugquirksQuirks related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0