Пример #1
0
 def _read_base_device(p_pyhouse_obj, p_xml):
     """
     @param p_xml: is the XML Element for the entire device
     @return: a Controller data object with the base info filled in
     """
     l_obj = ButtonData()  # Create an empty controller object.
     l_obj = deviceXML.read_base_device_object_xml(p_pyhouse_obj, l_obj, p_xml)
     l_obj.DeviceType = 1
     l_obj.DeviceSubType = 1
     return l_obj
Пример #2
0
 def _read_base_device(p_xml, p_version):
     """
     @param p_xml: is the XML Element for the entire device
     @param p_version: is some helper data to get the correct information from the config file.
     @return: a Controller data object with the base info filled in
     """
     l_obj = ButtonData()  #  Create an empty controller object.
     l_obj = LightingCoreAPI.read_core_lighting_xml(l_obj, p_xml, p_version)
     l_obj.DeviceSubType = 3
     return l_obj
Пример #3
0
 def setUp(self, p_root):
     self.m_pyhouse_obj = SetupPyHouseObj().BuildPyHouseObj(p_root)
     self.m_xml = SetupPyHouseObj().BuildXml(p_root)
     self.m_button_obj = ButtonData()
     self.m_controller_obj = ControllerData()
     self.m_light_obj = LightData()
     self.m_api = LightingCoreAPI()
Пример #4
0
 def setUp(self, p_root):
     self.m_pyhouse_obj = SetupPyHouseObj().BuildPyHouseObj(p_root)
     self.m_xml = SetupPyHouseObj().BuildXml(p_root)
     self.m_api = deviceXML
     self.m_button_obj = ButtonData()
     self.m_controller_obj = ControllerInformation()
     self.m_light_obj = LightData()
Пример #5
0
 def setUp(self, p_root):
     self.m_pyhouse_obj = SetupPyHouseObj().BuildPyHouseObj(p_root)
     self.m_xml = SetupPyHouseObj().BuildXml(p_root)
     self.m_family = familyAPI(self.m_pyhouse_obj).LoadFamilyTesting()
     self.m_pyhouse_obj.House.FamilyData = self.m_family
     self.m_api = buttonsAPI()
     self.m_button_obj = ButtonData()
     self.m_version = '1.4.0'
Пример #6
0
 def test_3_BaseButton(self):
     """ Read in the xml file and fill in the lights
     """
     l_obj = ButtonData()
     l_base = self.m_api.read_base_device_object_xml(
         self.m_pyhouse_obj, l_obj, self.m_xml.button)
     l_xml = self.m_api.write_base_device_object_xml('Light', l_base)
     self.assertEqual(l_xml.attrib['Name'], 'Insteon Button')
     self.assertEqual(l_xml.attrib['Key'], '0')
     self.assertEqual(l_xml.attrib['Active'], 'True')
Пример #7
0
 def test_03_BaseButton(self):
     """ Read in the xml file and fill in the lights
     """
     l_obj = ButtonData()
     l_base = self.m_api.read_base_device_object_xml(
         l_obj, self.m_xml.button)
     l_xml = self.m_api.write_base_device_object_xml('Light', l_base)
     # print(PrettyFormatAny.form(l_xml, 'C1-03-A - Base'))
     self.assertEqual(l_xml.attrib['Name'], TESTING_LIGHTING_BUTTON_NAME_0)
     self.assertEqual(l_xml.attrib['Key'], '0')
     self.assertEqual(l_xml.attrib['Active'], 'True')
Пример #8
0
 def test_03_ReadBaseButton(self):
     """ Read in the xml file and fill in the lights
     """
     l_obj = ButtonData()
     l_base = self.m_api.read_base_device_object_xml(
         l_obj, self.m_xml.button)
     self.assertEqual(l_base.Name, TESTING_LIGHTING_BUTTON_NAME_0)
     self.assertEqual(l_base.Key, 0)
     self.assertEqual(l_base.Active, True)
     self.assertEqual(l_base.Comment, TESTING_LIGHTING_BUTTON_COMMENT_0)
     self.assertEqual(l_base.RoomCoords.X_Easting,
                      float(TESTING_DEVICE_ROOM_X))
     self.assertEqual(l_base.DeviceFamily, TESTING_DEVICE_FAMILY_INSTEON)
     self.assertEqual(l_base.RoomName, TESTING_DEVICE_ROOM_NAME)