Exemplo n.º 1
0
 def test_from_knx_positive(self):
     """Test positive value from KNX."""
     assert DPTSignedRelativeValue.from_knx((0x00,)) == 0
     assert DPTSignedRelativeValue.from_knx((0x01,)) == 1
     assert DPTSignedRelativeValue.from_knx((0x02,)) == 2
     assert DPTSignedRelativeValue.from_knx((0x64,)) == 100
     assert DPTSignedRelativeValue.from_knx((0x7F,)) == 127
Exemplo n.º 2
0
 def test_from_knx_positive(self):
     """Test positive value from KNX."""
     self.assertEqual(DPTSignedRelativeValue.from_knx((0x00, )), 0)
     self.assertEqual(DPTSignedRelativeValue.from_knx((0x01, )), 1)
     self.assertEqual(DPTSignedRelativeValue.from_knx((0x02, )), 2)
     self.assertEqual(DPTSignedRelativeValue.from_knx((0x64, )), 100)
     self.assertEqual(DPTSignedRelativeValue.from_knx((0x7F, )), 127)
Exemplo n.º 3
0
 def test_from_knx_negative(self):
     """Test negative value from KNX."""
     assert DPTSignedRelativeValue.from_knx((0x80,)) == -128
     assert DPTSignedRelativeValue.from_knx((0x9C,)) == -100
     assert DPTSignedRelativeValue.from_knx((0xFE,)) == -2
     assert DPTSignedRelativeValue.from_knx((0xFF,)) == -1
Exemplo n.º 4
0
 def test_from_knx_negative(self):
     """Test negative value from KNX."""
     self.assertEqual(DPTSignedRelativeValue.from_knx((0x80, )), -128)
     self.assertEqual(DPTSignedRelativeValue.from_knx((0x9C, )), -100)
     self.assertEqual(DPTSignedRelativeValue.from_knx((0xFE, )), -2)
     self.assertEqual(DPTSignedRelativeValue.from_knx((0xFF, )), -1)