예제 #1
0
 def test_mode_from_knx(self):
     """Test parsing DPTHVACMode from KNX."""
     assert DPTHVACMode.from_knx((0x00,)) == HVACOperationMode.AUTO
     assert DPTHVACMode.from_knx((0x01,)) == HVACOperationMode.COMFORT
     assert DPTHVACMode.from_knx((0x02,)) == HVACOperationMode.STANDBY
     assert DPTHVACMode.from_knx((0x03,)) == HVACOperationMode.NIGHT
     assert DPTHVACMode.from_knx((0x04,)) == HVACOperationMode.FROST_PROTECTION
예제 #2
0
 def test_mode_from_knx(self):
     """Test parsing DPTHVACMode from KNX."""
     self.assertEqual(DPTHVACMode.from_knx((0x00,)), HVACOperationMode.AUTO)
     self.assertEqual(DPTHVACMode.from_knx((0x01,)), HVACOperationMode.COMFORT)
     self.assertEqual(DPTHVACMode.from_knx((0x02,)), HVACOperationMode.STANDBY)
     self.assertEqual(DPTHVACMode.from_knx((0x03,)), HVACOperationMode.NIGHT)
     self.assertEqual(
         DPTHVACMode.from_knx((0x04,)), HVACOperationMode.FROST_PROTECTION
     )
예제 #3
0
파일: climate_mode.py 프로젝트: vosc/xknx
 async def _process_operation_mode(self, telegram):
     """Process incoming telegram for operation mode."""
     if not isinstance(telegram.payload, DPTArray) \
             or len(telegram.payload.value) != 1:
         raise CouldNotParseTelegram("invalid payload", payload=telegram.payload, device_name=self.name)
     operation_mode = DPTHVACMode.from_knx(telegram.payload.value)
     await self._set_internal_operation_mode(operation_mode)
예제 #4
0
 def test_mode_from_knx_wrong_code(self):
     """Test parsing of DPTHVACMode with wrong code."""
     with pytest.raises(ConversionError):
         DPTHVACMode.from_knx((0x05, ))
예제 #5
0
 def test_mode_from_knx_wrong_value(self):
     """Test parsing of DPTControllerStatus with wrong value)."""
     with pytest.raises(ConversionError):
         DPTHVACMode.from_knx((1, 2))
예제 #6
0
 def test_mode_from_knx_wrong_code(self):
     """Test parsing of DPTHVACMode with wrong code."""
     with pytest.raises(CouldNotParseKNXIP):
         DPTHVACMode.from_knx((0x05,))