예제 #1
0
 def test_reponse_8102_vibration(self):
     msg_data = unhexlify(b'26a32301010105080025000800000448')
     r = responses.R8102(msg_data, 255)
     self.assertDictEqual(
         r.data,
         OrderedDict([('sequence', 38), ('addr', 'a323'), ('endpoint', 1),
                      ('cluster', 257), ('attribute', 0x0508),
                      ('status', 0), ('data_type', 37), ('size', 8),
                      ('data', '\x00\x00\x04H'), ('lqi', 255)]))
예제 #2
0
 def test_unsupported_attribute(self):
     # some device like profalux doesn't have model identifier
     device = core.Device({'addr': '1234', 'ieee': '0123456789abcdef'},
                          self.zigate)
     self.zigate._devices['1234'] = device
     r = responses.R8102(unhexlify(b'2f1234010000000586ff0000'), 255)
     r = self.zigate.interpret_response(r)
     self.assertEqual(device.properties,
                      [{'attribute': 5, 'data': 'unsupported', 'name': 'type',
                        'value': 'unsupported', 'type': str}])