Esempio n. 1
0
    def test_bytes(self):
        """Test FrameGetNodeInformationNotification."""
        frame = FrameGetNodeInformationNotification()
        frame.node_id = 23
        frame.order = 1234
        frame.placement = 2
        frame.name = "Fnord23"
        frame.velocity = Velocity.SILENT
        frame.node_type = NodeTypeWithSubtype.INTERIOR_VENETIAN_BLIND
        frame.product_group = 23
        frame.product_type = 13
        frame.node_variation = NodeVariation.TOPHUNG
        frame.power_mode = 1
        frame.build_number = 7
        frame.serial_number = "01:02:03:04:05:06:06:08"

        frame.state = 1
        frame.current_position = Position(position=12)
        frame.target = Position(position=123)
        frame.current_position_fp1 = Position(position=1234)
        frame.current_position_fp2 = Position(position=2345)
        frame.current_position_fp3 = Position(position=3456)
        frame.current_position_fp4 = Position(position=4567)
        frame.remaining_time = 1
        frame.timestamp = 50528771
        frame.alias_array = AliasArray(raw=b"\x0501234567890123456789")
        self.assertEqual(bytes(frame), self.EXAMPLE_FRAME)
Esempio n. 2
0
 def test_no_type(self):
     """Test convert_frame_to_node with no type (convert_frame_to_node should return None)."""
     frame = FrameGetNodeInformationNotification()
     frame.node_id = 23
     frame.name = "Fnord23"
     frame.node_type = NodeTypeWithSubtype.NO_TYPE
     frame.serial_number = "aa:bb:aa:bb:aa:bb:aa:23"
     pyvlx = PyVLX()
     self.assertEqual(convert_frame_to_node(pyvlx, frame), None)
Esempio n. 3
0
 def test_garage_door(self):
     """Test convert_frame_to_node garage door."""
     frame = FrameGetNodeInformationNotification()
     frame.node_id = 23
     frame.name = "Fnord23"
     frame.node_type = NodeTypeWithSubtype.GARAGE_DOOR_OPENER
     frame.serial_number = "aa:bb:aa:bb:aa:bb:aa:23"
     pyvlx = PyVLX()
     node = convert_frame_to_node(pyvlx, frame)
     self.assertEqual(
         node,
         GarageDoor(
             pyvlx=pyvlx,
             name="Fnord23",
             node_id=23,
             serial_number="aa:bb:aa:bb:aa:bb:aa:23",
         ),
     )
Esempio n. 4
0
 def test_roller_shutter(self):
     """Test convert_frame_to_node roller shutter."""
     frame = FrameGetNodeInformationNotification()
     frame.node_id = 23
     frame.name = "Fnord23"
     frame.node_type = NodeTypeWithSubtype.ROLLER_SHUTTER
     frame.serial_number = "aa:bb:aa:bb:aa:bb:aa:23"
     pyvlx = PyVLX()
     node = convert_frame_to_node(pyvlx, frame)
     self.assertEqual(
         node,
         RollerShutter(
             pyvlx=pyvlx,
             name="Fnord23",
             node_id=23,
             serial_number="aa:bb:aa:bb:aa:bb:aa:23",
         ),
     )
Esempio n. 5
0
 def test_blind(self):
     """Test convert_frame_to_node with blind."""
     frame = FrameGetNodeInformationNotification()
     frame.node_id = 23
     frame.name = "Fnord23"
     frame.node_type = NodeTypeWithSubtype.EXTERIOR_VENETIAN_BLIND
     frame.serial_number = "aa:bb:aa:bb:aa:bb:aa:23"
     pyvlx = PyVLX()
     node = convert_frame_to_node(pyvlx, frame)
     self.assertEqual(
         node,
         Blind(
             pyvlx=pyvlx,
             name="Fnord23",
             node_id=23,
             serial_number="aa:bb:aa:bb:aa:bb:aa:23",
         ),
     )
Esempio n. 6
0
 def test_light_on_off(self):
     """Test convert_frame_to_node with light_on_off."""
     frame = FrameGetNodeInformationNotification()
     frame.node_id = 23
     frame.name = "Fnord23"
     frame.node_type = NodeTypeWithSubtype.LIGHT_ON_OFF
     frame.serial_number = "aa:bb:aa:bb:aa:bb:aa:23"
     pyvlx = PyVLX()
     node = convert_frame_to_node(pyvlx, frame)
     self.assertEqual(
         node,
         Light(
             pyvlx=pyvlx,
             name="Fnord23",
             node_id=23,
             serial_number="aa:bb:aa:bb:aa:bb:aa:23",
         ),
     )
Esempio n. 7
0
 def test_blade(self):
     """Test convert_frame_to_node blade."""
     frame = FrameGetNodeInformationNotification()
     frame.node_id = 23
     frame.name = "Fnord23"
     frame.node_type = NodeTypeWithSubtype.BLADE_OPENER
     frame.serial_number = "aa:bb:aa:bb:aa:bb:aa:23"
     pyvlx = PyVLX()
     node = convert_frame_to_node(pyvlx, frame)
     self.assertEqual(
         node,
         Blade(
             pyvlx=pyvlx,
             name="Fnord23",
             node_id=23,
             serial_number="aa:bb:aa:bb:aa:bb:aa:23",
         ),
     )
Esempio n. 8
0
 def test_gate_with_angular_position(self):
     """Test convert_frame_to_node gate."""
     frame = FrameGetNodeInformationNotification()
     frame.node_id = 23
     frame.name = "Fnord23"
     frame.node_type = NodeTypeWithSubtype.GATE_OPENER_ANGULAR_POSITION
     frame.serial_number = "aa:bb:aa:bb:aa:bb:aa:23"
     pyvlx = PyVLX()
     node = convert_frame_to_node(pyvlx, frame)
     self.assertEqual(
         node,
         Gate(
             pyvlx=pyvlx,
             name="Fnord23",
             node_id=23,
             serial_number="aa:bb:aa:bb:aa:bb:aa:23",
         ),
     )
Esempio n. 9
0
 def test_linar_angular_position_of_garage_door(self):
     """Test convert_frame_to_node linar angular position of garage door."""
     frame = FrameGetNodeInformationNotification()
     frame.node_id = 23
     frame.name = "Fnord23"
     frame.node_type = NodeTypeWithSubtype.LINAR_ANGULAR_POSITION_OF_GARAGE_DOOR
     frame.serial_number = "aa:bb:aa:bb:aa:bb:aa:23"
     pyvlx = PyVLX()
     node = convert_frame_to_node(pyvlx, frame)
     self.assertEqual(
         node,
         GarageDoor(
             pyvlx=pyvlx,
             name="Fnord23",
             node_id=23,
             serial_number="aa:bb:aa:bb:aa:bb:aa:23",
         ),
     )
Esempio n. 10
0
 def test_window_with_rain_sensor(self):
     """Test convert_frame_to_node with window with rain sensor."""
     frame = FrameGetNodeInformationNotification()
     frame.node_id = 23
     frame.name = "Fnord23"
     frame.node_type = NodeTypeWithSubtype.WINDOW_OPENER_WITH_RAIN_SENSOR
     frame.serial_number = "aa:bb:aa:bb:aa:bb:aa:23"
     pyvlx = PyVLX()
     node = convert_frame_to_node(pyvlx, frame)
     self.assertEqual(
         node,
         Window(
             pyvlx=pyvlx,
             name="Fnord23",
             node_id=23,
             rain_sensor=True,
             serial_number="aa:bb:aa:bb:aa:bb:aa:23",
         ),
     )
Esempio n. 11
0
 def test_wrong_serial_number(self):
     """Test setting a wrong serial number."""
     frame = FrameGetNodeInformationNotification()
     with self.assertRaises(PyVLXException):
         frame.serial_number = "01:02:03:04:05:06:06"
Esempio n. 12
0
 def test_serial_number_not_set(self):
     """Test serial number property with not set."""
     frame = FrameGetNodeInformationNotification()
     self.assertEqual(frame.serial_number, None)
Esempio n. 13
0
 def test_serial_number(self):
     """Test serial number property."""
     frame = FrameGetNodeInformationNotification()
     frame.serial_number = "01:02:03:04:05:06:06:08"
     self.assertEqual(frame.serial_number, "01:02:03:04:05:06:06:08")