Commit 7f5b969a authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Interdomain component:

- removed unneeded constant for AGGREGATED topology name
- removed unused tools
- code reorganizations and factorizations
- implemented own-domain-finder class
- implemented first partial version of topology abstractor
- implemented abstract device class
parent 97248922
Loading
Loading
Loading
Loading
+0 −1
Changes for src/common/Constants.py: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ DEFAULT_METRICS_PORT = 9192
DEFAULT_CONTEXT_UUID     = 'admin'
DEFAULT_TOPOLOGY_UUID    = 'admin'      # contains the detailed local topology
DOMAINS_TOPOLOGY_UUID    = 'domains'    # contains the abstracted domains (abstracted local + abstracted remotes)
AGGREGATED_TOPOLOGY_UUID = 'aggregated' # contains the aggregated view (detailed local + abstracted remotes)

# Default service names
class ServiceNameEnum(Enum):
+190 −0
Changes for src/interdomain/service/topology_abstractor/AbstractDevice.py: 190 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import copy, logging
from typing import Dict, Optional, Tuple
from common.Constants import DEFAULT_TOPOLOGY_UUID, DOMAINS_TOPOLOGY_UUID
from common.DeviceTypes import DeviceTypeEnum
from common.proto.context_pb2 import (
    ContextId, Device, DeviceDriverEnum, DeviceId, DeviceOperationalStatusEnum, EndPoint)
from common.tools.object_factory.Device import json_device, json_device_id
from context.client.ContextClient import ContextClient
from interdomain.service.topology_abstractor.Tools import (
    add_device_to_topology, create_missing_topologies, find_own_domain_uuid, get_devices_in_topology,
    get_existing_device_uuids)

LOGGER = logging.getLogger(__name__)

class AbstractDevice:
    def __init__(self):
        self.__context_client = ContextClient()

        self.__own_context_id : Optional[ContextId] = None
        self.__own_domain_uuid : Optional[str] = None # uuid of own_context_id

        self.__own_abstract_device : Optional[Device] = None
        self.__own_abstract_device_id : Optional[DeviceId] = None

        # Dict[device_uuid, Dict[endpoint_uuid, Tuple[interdomain_endpoint_uuid, abstract EndPoint]]]
        self.__device_endpoint_to_abstract : Dict[str, Dict[str, Tuple[str, EndPoint]]] = dict()

        # Dict[interdomain_endpoint_uuid, Tuple[device_uuid, endpoint_uuid]]
        self.__abstract_to_device_endpoint : Dict[str, Tuple[str, str]] = dict()

    @property
    def own_context_id(self): return self.__own_context_id

    @property
    def own_domain_uuid(self): return self.__own_domain_uuid

    @property
    def own_abstract_device_uuid(self): return self.__own_domain_uuid

    @property
    def own_abstract_device_id(self): return self.__own_abstract_device_id

    @property
    def own_abstract_device(self): return self.__own_abstract_device

    def _load_existing_abstract_device(self) -> None:
        self.__device_endpoint_to_abstract = dict()
        self.__abstract_to_device_endpoint = dict()

        self.__own_abstract_device_id = DeviceId(**json_device_id(self.__own_domain_uuid))
        self.__own_abstract_device = self.__context_client.GetDevice(self.__own_abstract_device_id)

        # for each endpoint in own_abstract_device, populate internal data structures and mappings
        for interdomain_endpoint in self.__own_abstract_device.device_endpoints:
            interdomain_endpoint_uuid : str = interdomain_endpoint.endpoint_id.endpoint_uuid.uuid
            endpoint_uuid,device_uuid = interdomain_endpoint_uuid.split('@', maxsplit=1)

            interdomain_endpoint_tuple = (interdomain_endpoint_uuid, interdomain_endpoint)
            self.__device_endpoint_to_abstract\
                .setdefault(device_uuid, {}).setdefault(endpoint_uuid, interdomain_endpoint_tuple)
            self.__abstract_to_device_endpoint\
                .setdefault(interdomain_endpoint_uuid, (device_uuid, endpoint_uuid))

    def _create_empty_abstract_device(self) -> None:
        own_abstract_device_uuid = self.__own_domain_uuid

        own_abstract_device = Device(**json_device(
            own_abstract_device_uuid, DeviceTypeEnum.NETWORK.value,
            DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED,
            endpoints=[], config_rules=[], drivers=[DeviceDriverEnum.DEVICEDRIVER_UNDEFINED]
        ))
        self.__context_client.SetDevice(own_abstract_device)
        self.__own_abstract_device = own_abstract_device
        self.__own_abstract_device_id = self.__own_abstract_device.device_id

        # Add own abstract device to topologies ["domains"]
        topology_uuids = [DOMAINS_TOPOLOGY_UUID]
        for topology_uuid in topology_uuids:
            add_device_to_topology(
                self.__context_client, self.__own_context_id, topology_uuid, own_abstract_device_uuid)

    def _discover_or_create_abstract_device(self) -> bool:
        # already discovered
        if self.__own_abstract_device is not None: return False

        # discover from existing devices; should have name of the own domain context
        existing_device_uuids = get_existing_device_uuids(self.__context_client)
        create_abstract_device = self.__own_domain_uuid not in existing_device_uuids
        if create_abstract_device:
            self._create_empty_abstract_device()
        else:
            self._load_existing_abstract_device()
        return create_abstract_device

    def _update_endpoint_type(self, device_uuid : str, endpoint_uuid : str, endpoint_type : str) -> bool:
        device_endpoint_to_abstract = self.__device_endpoint_to_abstract.get(device_uuid, {})
        interdomain_endpoint_tuple = device_endpoint_to_abstract.get(endpoint_uuid)
        _, interdomain_endpoint = interdomain_endpoint_tuple
        interdomain_endpoint_type = interdomain_endpoint.endpoint_type
        if endpoint_type == interdomain_endpoint_type: return False
        interdomain_endpoint.endpoint_type = endpoint_type
        return True

    def _add_interdomain_endpoint(
        self, device_uuid : str, endpoint_uuid : str, endpoint_type : str, interdomain_endpoint_uuid : str
    ) -> EndPoint:
        interdomain_endpoint = self.__own_abstract_device.device_endpoints.add()
        interdomain_endpoint.endpoint_id.device_id.CopyFrom(self.__own_abstract_device_id)
        interdomain_endpoint.endpoint_id.endpoint_uuid.uuid = interdomain_endpoint_uuid
        interdomain_endpoint.endpoint_type = endpoint_type

        interdomain_endpoint_tuple = (interdomain_endpoint_uuid, interdomain_endpoint)
        self.__device_endpoint_to_abstract\
            .setdefault(device_uuid, {}).setdefault(endpoint_uuid, interdomain_endpoint_tuple)
        self.__abstract_to_device_endpoint\
            .setdefault(interdomain_endpoint_uuid, (device_uuid, endpoint_uuid))

        return interdomain_endpoint

    def _remove_interdomain_endpoint(
        self, device_uuid : str, endpoint_uuid : str, interdomain_endpoint_tuple : Tuple[str, EndPoint]
    ) -> None:
        interdomain_endpoint_uuid, interdomain_endpoint = interdomain_endpoint_tuple
        self.__abstract_to_device_endpoint.pop(interdomain_endpoint_uuid, None)
        device_endpoint_to_abstract = self.__device_endpoint_to_abstract.get(device_uuid, {})
        device_endpoint_to_abstract.pop(endpoint_uuid, None)
        self.__own_abstract_device.device_endpoints.remove(interdomain_endpoint)

    def update_abstract_device_endpoints(self, device : Device) -> bool:
        device_uuid = device.device_id.device_uuid.uuid
        LOGGER
        device_border_endpoint_uuids = {
            endpoint.endpoint_id.endpoint_uuid.uuid : endpoint.endpoint_type
            for endpoint in device.device_endpoints
            if str(endpoint.endpoint_type).endswith('/border')
        }

        updated = False

        # for each border endpoint in own_abstract_device that is not in device; remove from own_abstract_device
        device_endpoint_to_abstract = self.__device_endpoint_to_abstract.get(device_uuid, {})
        _device_endpoint_to_abstract = copy.deepcopy(device_endpoint_to_abstract)
        for endpoint_uuid, interdomain_endpoint_tuple in _device_endpoint_to_abstract.items():
            if endpoint_uuid in device_border_endpoint_uuids: continue
            # remove interdomain endpoint that is not in device
            self._remove_interdomain_endpoint(device_uuid, endpoint_uuid, interdomain_endpoint_tuple)
            updated = True

        # for each border endpoint in device that is not in own_abstract_device; add to own_abstract_device
        for endpoint_uuid,endpoint_type in device_border_endpoint_uuids.items():
            # compose interdomain endpoint uuid
            interdomain_endpoint_uuid = '{:s}@{:s}'.format(endpoint_uuid, device_uuid)

            # if already added; just check endpoint type is not modified
            if interdomain_endpoint_uuid in self.__abstract_to_device_endpoint:
                updated = updated or self._update_endpoint_type(device_uuid, endpoint_uuid, endpoint_type)
                continue

            # otherwise, add it to the abstract device
            self._add_interdomain_endpoint(device_uuid, endpoint_uuid, endpoint_type, interdomain_endpoint_uuid)
            updated = True

        return updated

    def initialize(self) -> Optional[bool]:
        if self.__own_abstract_device is not None: return False

        # Discover or Create device representing abstract local domain
        self._discover_or_create_abstract_device()

        devices_in_admin_topology = get_devices_in_topology(
            self.__context_client, self.__own_context_id, DEFAULT_TOPOLOGY_UUID)
        for device in devices_in_admin_topology:
            self.update_abstract_device_endpoints(device)

        return True
+56 −0
Changes for src/interdomain/service/topology_abstractor/OwnDomainFinder.py: 56 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import copy, logging
from typing import Optional, Set
from common.Constants import DEFAULT_CONTEXT_UUID
from common.proto.context_pb2 import Empty
from context.client.ContextClient import ContextClient

LOGGER = logging.getLogger(__name__)

class OwnDomainFinder:
    def __new__(cls):
        if not hasattr(cls, 'instance'):
            cls.instance = super(OwnDomainFinder, cls).__new__(cls)
        return cls.instance

    def __init__(self) -> None:
        self.__context_client = ContextClient()
        self.__own_domain_uuid : Optional[str] = None
        self.__existing_context_uuids : Optional[Set[str]] = None

    def __update(self) -> None:
        existing_context_ids = self.__context_client.ListContextIds(Empty())
        existing_context_uuids = {context_id.context_uuid.uuid for context_id in existing_context_ids.context_ids}

        # Detect local context name (will be used as abstracted device name); exclude DEFAULT_CONTEXT_UUID
        existing_non_admin_context_uuids = copy.deepcopy(existing_context_uuids)
        existing_non_admin_context_uuids.discard(DEFAULT_CONTEXT_UUID)
        if len(existing_non_admin_context_uuids) != 1:
            MSG = 'Unable to identify own domain name. Existing Contexts({:s})'
            raise Exception(MSG.format(str(existing_context_uuids)))
        
        self.__own_domain_uuid = existing_non_admin_context_uuids.pop()
        self.__existing_context_uuids = existing_context_uuids

    @property
    def own_domain_uuid(self) -> Optional[str]:
        if self.__own_domain_uuid is None: self.__update()
        return self.__own_domain_uuid

    @property
    def existing_context_uuids(self) -> Optional[Set[str]]:
        if self.__existing_context_uuids is None: self.__update()
        return self.__existing_context_uuids
+77 −0
Changes for src/interdomain/service/topology_abstractor/Tools.py: 77 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import copy, logging
from typing import List, Set, Tuple
from common.Constants import DEFAULT_CONTEXT_UUID
from common.proto.context_pb2 import ContextId, Device, DeviceId, Empty, EndPointId, Topology, TopologyId
from common.tools.object_factory.Device import json_device_id
from common.tools.object_factory.Topology import json_topology, json_topology_id
from context.client.ContextClient import ContextClient

LOGGER = logging.getLogger(__name__)

def create_missing_topologies(
    context_client : ContextClient, context_id : ContextId, topology_uuids : List[str]
) -> None:
    # Find existing topologies within own context
    existing_topology_ids = context_client.ListTopologyIds(context_id)
    existing_topology_uuids = {topology_id.topology_uuid.uuid for topology_id in existing_topology_ids.topology_ids}

    # Create topologies within provided context
    for topology_uuid in topology_uuids:
        if topology_uuid in existing_topology_uuids: continue
        grpc_topology = Topology(**json_topology(topology_uuid, context_id=context_id))
        context_client.SetTopology(grpc_topology)

def get_existing_device_uuids(context_client : ContextClient) -> Set[str]:
    existing_device_ids = context_client.ListDeviceIds(Empty())
    existing_device_uuids = {device_id.device_uuid.uuid for device_id in existing_device_ids.device_ids}
    return existing_device_uuids

def add_device_to_topology(
    context_client : ContextClient, context_id : ContextId, topology_uuid : str, device_uuid : str
) -> bool:
    topology_id = TopologyId(**json_topology_id(topology_uuid, context_id=context_id))
    topology_ro = context_client.GetTopology(topology_id)
    device_uuids = {device_id.device_uuid.uuid for device_id in topology_ro.device_ids}
    if device_uuid in device_uuids: return False # already existed

    topology_rw = Topology()
    topology_rw.CopyFrom(topology_ro)
    topology_rw.device_ids.add().device_uuid.uuid = device_uuid
    context_client.SetTopology(topology_rw)
    return True

def get_uuids_of_devices_in_topology(
    context_client : ContextClient, context_id : ContextId, topology_uuid : str
) -> List[str]:
    topology_id = TopologyId(**json_topology_id(topology_uuid, context_id=context_id))
    topology = context_client.GetTopology(topology_id)
    device_uuids = [device_id.device_uuid.uuid for device_id in topology.device_ids]
    return device_uuids

def get_devices_in_topology(
    context_client : ContextClient, context_id : ContextId, topology_uuid : str
) -> List[Device]:
    device_uuids = get_uuids_of_devices_in_topology(context_client, context_id, topology_uuid) 

    all_devices = context_client.ListDevices(Empty())
    devices_in_topology = list()
    for device in all_devices.devices:
        device_uuid = device.device_id.device_uuid.uuid
        if device_uuid not in device_uuids: continue
        devices_in_topology.append(device)

    return devices_in_topology
+94 −29
Changes for src/interdomain/service/topology_abstractor/TopologyAbstractor.py: 94 added lines, 29 removed lines.
Original line number Diff line number Diff line
@@ -12,25 +12,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import threading
import logging, threading
import logging, networkx, threading
from typing import List, Optional, Union
from common.Constants import AGGREGATED_TOPOLOGY_UUID, DOMAINS_TOPOLOGY_UUID
from common.proto.context_pb2 import (
    ConnectionEvent, ContextEvent, ContextId, DeviceEvent, DeviceId, LinkEvent, ServiceEvent, ServiceId,
    SliceEvent, SliceId, TopologyEvent)
from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID, DOMAINS_TOPOLOGY_UUID
from common.proto.context_pb2 import ContextEvent, ContextId, DeviceEvent, DeviceId, ServiceId, SliceId, TopologyEvent
from common.tools.grpc.Tools import grpc_message_to_json_string
from common.tools.object_factory.Context import json_context_id
from common.tools.object_factory.Device import json_device_id
from context.client.ContextClient import ContextClient
from context.client.EventsCollector import EventsCollector
from dlt.connector.client.DltConnectorClient import DltConnectorClient
from .tools.ContextMethods import create_abstracted_device_if_not_exists, create_interdomain_entities
from interdomain.service.topology_abstractor.Tools import create_missing_topologies, get_uuids_of_devices_in_topology
from interdomain.service.topology_abstractor.Types import DltRecordIdTypes, EventTypes
from .AbstractDevice import AbstractDevice
from .OwnDomainFinder import OwnDomainFinder

LOGGER = logging.getLogger(__name__)

DltRecordIdTypes = Union[DeviceId, SliceId, ServiceId]
EventTypes = Union[
    ContextEvent, TopologyEvent, DeviceEvent, LinkEvent, ServiceEvent, SliceEvent, ConnectionEvent
]

class TopologyAbstractor(threading.Thread):
    def __init__(self) -> None:
        super().__init__(daemon=True)
@@ -41,7 +39,9 @@ class TopologyAbstractor(threading.Thread):
        self.context_event_collector = EventsCollector(self.context_client)

        self.own_context_id : Optional[ContextId] = None
        self.own_abstract_device : Optional[ContextId] = None
        self.own_domain_filder = OwnDomainFinder()
        self.abstract_topology = networkx.Graph()
        self.abstract_device = AbstractDevice()

    def stop(self):
        self.terminate.set()
@@ -57,7 +57,7 @@ class TopologyAbstractor(threading.Thread):
            if self.ignore_event(event): continue
            # TODO: filter events resulting from abstraction computation
            # TODO: filter events resulting from updating remote abstractions
            LOGGER.info('Processing Event({:s})...'.format(str(event)))
            LOGGER.info('Processing Event({:s})...'.format(grpc_message_to_json_string(event)))
            dlt_records = self.update_abstraction(event)
            self.send_dlt_records(dlt_records)

@@ -66,18 +66,18 @@ class TopologyAbstractor(threading.Thread):
        self.dlt_connector_client.close()

    def ignore_event(self, event : EventTypes) -> List[DltRecordIdTypes]:
        if isinstance(event, ContextEvent):
            context_uuid = event.context_id.context_uuid.uuid
        if self.own_context_id is None: return False
        own_context_uuid = self.own_context_id.context_uuid.uuid

        if isinstance(event, ContextEvent):
            context_uuid = event.context_id.context_uuid.uuid
            return context_uuid == own_context_uuid
        elif isinstance(event, TopologyEvent):
            context_uuid = event.topology_id.context_id.context_uuid.uuid
            if self.own_context_id is None: return False
            own_context_uuid = self.own_context_id.context_uuid.uuid
            if context_uuid != own_context_uuid: return True
            topology_uuid = event.topology_id.topology_uuid.uuid
            if topology_uuid in {DOMAINS_TOPOLOGY_UUID, AGGREGATED_TOPOLOGY_UUID}: return True
            if topology_uuid in {DOMAINS_TOPOLOGY_UUID}: return True

        return False

    def send_dlt_records(self, dlt_records : Union[DltRecordIdTypes, List[DltRecordIdTypes]]) -> None:
@@ -91,21 +91,86 @@ class TopologyAbstractor(threading.Thread):
            else:
                LOGGER.error('Unsupported Record({:s})'.format(str(dlt_record_id)))

    def update_abstraction(self, event : Optional[EventTypes] = None) -> List[DltRecordIdTypes]:
        dlt_record_ids_with_changes = []
    def _initialize_context_and_topologies(self) -> None:
        if self.own_context_id is not None: return

        own_domain_uuid = self.own_domain_filder.own_domain_uuid
        if own_domain_uuid is None: return

        if self.own_context_id is None:
            self.own_context_id = create_interdomain_entities(self.context_client)
        # Find own domain UUID and own ContextId
        self.own_context_id = ContextId(**json_context_id(own_domain_uuid))

        if self.own_abstract_device is None:
            self.own_abstract_device = create_abstracted_device_if_not_exists(self.context_client, self.own_context_id)
            dlt_record_ids_with_changes.append(self.own_abstract_device.device_id)
        # If "admin" context does not exist, create it; should exist
        #if DEFAULT_CONTEXT_UUID not in existing_context_uuids:
        #    self.context_client.SetContext(Context(**json_context(DEFAULT_CONTEXT_UUID)))
        #self.__admin_context_id = ContextId(**json_context_id(DEFAULT_CONTEXT_UUID))

        # Create topologies "admin", "domains", and "aggregated" within own context
        topology_uuids = [DEFAULT_TOPOLOGY_UUID, DOMAINS_TOPOLOGY_UUID]
        create_missing_topologies(self.context_client, self.own_context_id, topology_uuids)

    def update_abstraction(self, event : EventTypes) -> List[DltRecordIdTypes]:
        dlt_record_ids_with_changes = []
        changed = False

        # TODO: identify changes from event and update endpoints accordingly
        if event is None:
            # TODO: identify initial status from topology and update endpoints accordingly
            # just initializing, do nothing
            pass

        elif isinstance(event, ContextEvent):
            context_id = event.context_id
            context_uuid = context_id.context_uuid.uuid
            if (context_uuid != DEFAULT_CONTEXT_UUID) and (self.own_context_id is None):
                self._initialize_context_and_topologies()

                own_domain_uuid = self.own_domain_filder.own_domain_uuid

                if self.abstract_topology.has_node(own_domain_uuid):
                    abstract_device = self.abstract_topology.nodes[own_domain_uuid]['obj']
                else:
            # TODO: identify changes from event and update endpoints accordingly
            pass
                    abstract_device = AbstractDevice()
                    self.abstract_topology.add_node(own_domain_uuid, obj=abstract_device)

                # if already initialized, does nothing and returns False
                # if own context UUID cannot be identified, does nothing and returns None
                # if own context UUID be identified, initialized the abstract device and returns True
                _changed = abstract_device.initialize()
                if _changed is None: return dlt_record_ids_with_changes
                changed = changed or _changed
            else:
                LOGGER.warning('Ignoring Event({:s})'.format(grpc_message_to_json_string(event)))

        elif isinstance(event, TopologyEvent):
            topology_id = event.topology_id
            topology_uuid = topology_id.topology_uuid.uuid
            context_id = topology_id.context_id
            context_uuid = context_id.context_uuid.uuid
            if (context_uuid == self.own_domain_filder.own_domain_uuid) and (topology_uuid == DEFAULT_TOPOLOGY_UUID):
                topology = self.context_client.GetTopology(event.topology_id)
                for device_id in topology.device_ids:
                    device = self.context_client.GetDevice(device_id)
                    _changed = self.abstract_device.update_abstract_device_endpoints(device)
                    changed = changed or _changed
            else:
                LOGGER.warning('Ignoring Event({:s})'.format(grpc_message_to_json_string(event)))
            
        elif isinstance(event, DeviceEvent):
            admin_topology_device_uuids = get_uuids_of_devices_in_topology(
                self.context_client, self.own_context_id, DEFAULT_TOPOLOGY_UUID)
            device_uuid = event.device_id.device_uuid.uuid
            if device_uuid in admin_topology_device_uuids:
                device = self.context_client.GetDevice(event.device_id)
                _changed = self.abstract_device.update_abstract_device_endpoints(device)
                changed = changed or _changed
            else:
                LOGGER.warning('Ignoring Event({:s})'.format(grpc_message_to_json_string(event)))

        else:
            LOGGER.warning('Unsupported Event({:s})'.format(grpc_message_to_json_string(event)))

        if changed:
            self.context_client.SetDevice(self.abstract_device.own_abstract_device)
            dlt_record_ids_with_changes.append(self.abstract_device.own_abstract_device_id)

        return dlt_record_ids_with_changes
Loading