(self)
return DEVICE_CLASS_TO_YANDEX_TYPES.get((domain, device_class), DOMAIN_TO_YANDEX_TYPES.get(domain))
Yandex type based on domain and device class.
Yandex type based on domain and device class.
Yandex type based on domain and device class .
def yandex_device_type(self) -> str | None:
        """Yandex type based on domain and device class."""
        entity_config = self.config.get_entity_config(self.entity_id)
        if CONF_TYPE in entity_config:
            return entity_config[CONF_TYPE]

        device_class = self.state.attributes.get(ATTR_DEVICE_CLASS)
        domain = self.state.domain
        return DEVICE_CLASS_TO_YANDEX_TYPES.get((domain, device_class), DOMAIN_TO_YANDEX_TYPES.get(domain))
def yandex_device_type ( self ) -> str | None : entity_config = self . config . get_entity_config ( self . entity_id ) if CONF_TYPE in entity_config : return entity_config [ CONF_TYPE ] device_class = self . state . attributes . get ( ATTR_DEVICE_CLASS ) domain = self . state . domain return DEVICE_CLASS_TO_YANDEX_TYPES . get ( ( domain , device_class ) , DOMAIN_TO_YANDEX_TYPES . get ( domain ) )