(entity_entry: RegistryEntry | None, device_entry: DeviceEntry | None,
                        area_reg: AreaRegistry)
return area_reg.areas.get(area_id)
Calculate the area for an entity.
Calculate the area for an entity.
Calculate the area for an entity .
async def _get_area(entity_entry: RegistryEntry | None, device_entry: DeviceEntry | None,
                        area_reg: AreaRegistry) -> AreaEntry | None:
        """Calculate the area for an entity."""
        if entity_entry and entity_entry.area_id:
            area_id = entity_entry.area_id
        elif device_entry and device_entry.area_id:
            area_id = device_entry.area_id
        else:
            return None

        return area_reg.areas.get(area_id)
async def _get_area ( entity_entry : RegistryEntry | None , device_entry : DeviceEntry | None , area_reg : AreaRegistry ) -> AreaEntry | None : if entity_entry and entity_entry . area_id : area_id = entity_entry . area_id elif device_entry and device_entry . area_id : area_id = device_entry . area_id else : return None return area_reg . areas . get ( area_id )