Beispiel #1
0
 def set_state(self, state):
     state_v = IotValue()
     state_v.string = state
     data = IotNvpSeq()
     data.append(IotNvp('state', state_v))
     
     self._thing.write('state', data)
Beispiel #2
0
    def alarm(self, message):
        alarm_v = IotValue()
        alarm_v.string = message
        alarm_data = IotNvpSeq()
        alarm_data.append(IotNvp('alarm', alarm_v))

        self._thing.write('alarm', alarm_data)
Beispiel #3
0
 def write_sample(self, barcode, x, y, z):
     barcode_v = IotValue()
     barcode_v.string = barcode
     position_x_v = IotValue()
     position_x_v.int32 = x
     position_y_v = IotValue()
     position_y_v.int32 = y
     position_z_v = IotValue()
     position_z_v.int32 = z
     
     data = IotNvpSeq()
     data.append(IotNvp('barcode', barcode_v))
     data.append(IotNvp('position_x', position_x_v))
     data.append(IotNvp('position_y', position_y_v))
     data.append(IotNvp('position_z', position_z_v))
     
     self._thing.write('observation', self.get_flow_id(barcode), data)