def create_thing(self):
        # Register the protobuf TagGroup
        tag_groups.Temperature_register_with_datariver(self._dr)

        # Create and Populate the ThingClass registry with JSON resource files.
        tcr = JSonThingClassRegistry()
        tcr.register_thing_classes_from_uri(
            get_abs_file_uri(
                'definitions/ThingClass/com.adlinktech.example.protobuf/TemperatureSensorThingClass.json'
            ))
        self._dr.add_thing_class_registry(tcr)

        # Create a Thing based on properties specified in a JSON resource file.
        tp = JSonThingProperties()
        tp.read_properties_from_uri(self._thing_properties_uri)
        return ThingEx(self._dr.create_thing(tp))
    def create_thing(self):
        # Create and Populate the TagGroup registry with JSON resource files.
        Throughput_register_with_datariver(self._datariver)

        # Create and Populate the ThingClass registry with JSON resource files.
        tcr = JSonThingClassRegistry()
        tcr.register_thing_classes_from_uri(
            'file://definitions/ThingClass/com.adlinktech.example.protobuf/ThroughputWriterThingClass.json'
        )
        self._datariver.add_thing_class_registry(tcr)

        # Create a Thing based on properties specified in a JSON resource file.
        tp = JSonThingProperties()
        tp.read_properties_from_uri(self._thing_properties_uri)

        return ThingEx(self._datariver.create_thing(tp))
Example #3
0
    def create_thing(self):
        # Create and Populate the TagGroup registry with JSON resource files.
        CameraState_register_with_datariver(self._datariver)
        IlluminanceAlarm_register_with_datariver(self._datariver)
        Illuminance_register_with_datariver(self._datariver)
        Observation_register_with_datariver(self._datariver)
        
 
        # Create and Populate the ThingClass registry with JSON resource files.
        tcr = JSonThingClassRegistry()
        tcr.register_thing_classes_from_uri(get_abs_file_uri('definitions/ThingClass/com.adlinktech.example.protobuf/CameraThingClass.json'))
        self._datariver.add_thing_class_registry(tcr)
 
        # Create a Thing based on properties specified in a JSON resource file.
        tp = JSonThingProperties()
        tp.read_properties_from_uri(self._thing_properties_uri)
        return ThingEx(self._datariver.create_thing(tp))
Example #4
0
    def create_thing(self):
        # Add listener for discovery of Things
        self._datariver.add_listener(self._new_thing_discovered_listener,
                                     self._dispatcher)

        # Create and Populate the ThingClass registry with JSON resource files.
        tcr = JSonThingClassRegistry()
        tcr.register_thing_classes_from_uri(
            'file://definitions/ThingClass/com.adlinktech.example.protobuf/ThingBrowserThingClass.json'
        )
        self._datariver.add_thing_class_registry(tcr)

        # Create a Thing based on properties specified in a JSON resource file.
        tp = JSonThingProperties()
        tp.read_properties_from_uri(self._thing_properties_uri)

        return ThingEx(self._datariver.create_thing(tp))