def test_from_knx(self): """Test from_knx function with normal operation.""" xknx = XKNX() remote_value = RemoteValueColorRGBW(xknx) self.assertEqual( remote_value.from_knx( DPTArray((0x64, 0x65, 0x66, 0x7F, 0x00, 0x00))), [0, 0, 0, 0], ) self.assertEqual( remote_value.from_knx( DPTArray((0x64, 0x65, 0x66, 0x7F, 0x00, 0x0F))), [100, 101, 102, 127], ) self.assertEqual( remote_value.from_knx( DPTArray((0x64, 0x65, 0x66, 0x7F, 0x00, 0x00))), [100, 101, 102, 127], ) self.assertEqual( remote_value.from_knx( DPTArray((0xFF, 0x65, 0x66, 0xFF, 0x00, 0x09))), [255, 101, 102, 255], ) self.assertEqual( remote_value.from_knx( DPTArray((0x64, 0x65, 0x66, 0x7F, 0x00, 0x01))), [255, 101, 102, 127], )
def test_from_knx(self): """Test from_knx function with normal operation.""" xknx = XKNX() remote_value = RemoteValueColorRGBW(xknx) assert remote_value.from_knx( DPTArray((0x64, 0x65, 0x66, 0x7F, 0x00, 0x00))) == (0, 0, 0, 0) assert remote_value.from_knx( DPTArray( (0x64, 0x65, 0x66, 0x7F, 0x00, 0x0F))) == (100, 101, 102, 127) assert remote_value.from_knx( DPTArray( (0x64, 0x65, 0x66, 0x7F, 0x00, 0x00))) == (100, 101, 102, 127) assert remote_value.from_knx( DPTArray( (0xFF, 0x65, 0x66, 0xFF, 0x00, 0x09))) == (255, 101, 102, 255) assert remote_value.from_knx( DPTArray( (0x64, 0x65, 0x66, 0x7F, 0x00, 0x01))) == (255, 101, 102, 127)