Example #1
0
 def _read_interface_data(_p_pyhouse_obj, p_obj, p_xml):
     try:
         interfaceXML.read_interface_xml(p_obj, p_xml)
     except Exception as e_err:  # DeviceFamily invalid or missing
         LOG.error('ERROR - Read Interface Data - {} - {} - {}'.format(
             e_err, p_obj.Name, p_obj.InterfaceType))
     return p_obj
Example #2
0
 def test_0202_All(self):
     """ Be sure that the XML contains the right stuff.
     """
     interfaceXml.read_interface_xml(self.m_controller_obj, self.m_xml.controller)
     self.assertEqual(self.m_xml.root.tag, 'PyHouse', 'Invalid XML - not a PyHouse XML config file')
     self.assertEqual(self.m_xml.controller_sect.tag, 'ControllerSection', 'XML - No Controllers section')
     self.assertEqual(self.m_xml.controller.tag, 'Controller', 'XML - No Controller section')
Example #3
0
 def test_01_All(self):
     """ Be sure that the XML contains the right stuff.
     """
     l_controllers = self.m_ctlr_api.read_all_controllers_xml(self.m_pyhouse_obj)
     self.m_pyhouse_obj.House.Lighting.Controllers = l_controllers
     print(PrettyFormatAny.form(l_controllers[0], 'R1-01-A - Controller Obj'))
     print(PrettyFormatAny.form(self.m_xml.controller, 'R1-01-B - Controller Xml'))
     interfaceXml.read_interface_xml(l_controllers[0], self.m_xml.controller)
     print(PrettyFormatAny.form(l_controllers[0], 'R1-01-C - Controller Obj'))
Example #4
0
 def test_0202_All(self):
     """ Be sure that the XML contains the right stuff.
     """
     interfaceXml.read_interface_xml(self.m_controller_obj,
                                     self.m_xml.controller)
     self.assertEqual(self.m_xml.root.tag, 'PyHouse',
                      'Invalid XML - not a PyHouse XML config file')
     self.assertEqual(self.m_xml.controller_sect.tag, 'ControllerSection',
                      'XML - No Controllers section')
     self.assertEqual(self.m_xml.controller.tag, 'Controller',
                      'XML - No Controller section')
Example #5
0
 def test_01_All(self):
     """ Be sure that the XML contains the right stuff.
     """
     l_controllers = self.m_ctlr_api.read_all_controllers_xml(
         self.m_pyhouse_obj)
     self.m_pyhouse_obj.House.Lighting.Controllers = l_controllers
     # print(PrettyFormatAny.form(l_controllers[0], 'R1-01-A - Controller Obj'))
     # print(PrettyFormatAny.form(self.m_xml.controller, 'R1-01-B - Controller Xml'))
     interfaceXml.read_interface_xml(l_controllers[0],
                                     self.m_xml.controller)
     print(
         PrettyFormatAny.form(l_controllers[0], 'R1-01-C - Controller Obj'))
Example #6
0
 def test_02_ExtractXML(self):
     l_controllers = self.m_ctlr_api.read_all_controllers_xml(
         self.m_pyhouse_obj)
     print(
         PrettyFormatAny.form(l_controllers[0],
                              'A3-02-A - First Controller Obj'))
     l_interface = interfaceXml.read_interface_xml(self.m_controller_obj,
                                                   l_controllers[0])
     print(
         PrettyFormatAny.form(l_interface,
                              'A3-02-B - First Controller Obj'))
Example #7
0
 def test_02_ExtractXML(self):
     l_controllers = self.m_ctlr_api.read_all_controllers_xml(
         self.m_pyhouse_obj)
     l_interface = interfaceXml.read_interface_xml(self.m_controller_obj,
                                                   l_controllers[0])
     print(
         PrettyFormatAny.form(l_controllers[0], 'W1-02-A - Controller Obj'))
     print(PrettyFormatAny.form(l_interface, 'W1-02-B - Controller Obj'))
     self.assertEqual(l_xml.attrib['Name'], TESTING_LIGHT_NAME_0)
     self.assertEqual(l_xml.attrib['Key'], TESTING_LIGHT_KEY_0)
     self.assertEqual(l_xml.attrib['Active'], TESTING_LIGHT_ACTIVE_0)
     self.assertEqual(l_xml.find('UUID').text, TESTING_LIGHT_UUID_0)
     self.assertEqual(l_xml.find('Comment').text, TESTING_LIGHT_COMMENT_0)
     self.assertEqual(
         l_xml.find('DeviceFamily').text, TESTING_DEVICE_FAMILY_INSTEON)
Example #8
0
 def _write_interface_data(p_obj, p_xml):
     try:
         interfaceXML.write_interface_xml(p_obj, p_xml)
     except Exception:
         pass
     return p_xml
Example #9
0
 def _read_interface_data(p_obj, p_xml, _p_version):
     try:
         interfaceXML.read_interface_xml(p_obj, p_xml)
     except Exception as e_err:  # DeviceFamily invalid or missing
         LOG.error('ERROR - Read Interface Data - {} - {} - {}'.format(e_err, p_obj.Name, p_obj.InterfaceType))
     return p_obj
Example #10
0
 def _write_interface_data(p_obj, p_xml):
     try:
         interfaceXML.write_interface_xml(p_obj, p_xml)
     except Exception:
         pass
     return p_xml
Example #11
0
 def test_0211_ExtractXML(self):
     l_controllers = self.m_ctlr_api.read_all_controllers_xml(
         self.m_pyhouse_obj)
     l_interface = interfaceXml.read_interface_xml(self.m_controller_obj,
                                                   l_controllers[0])
Example #12
0
 def test_0211_ExtractXML(self):
     l_controllers = self.m_ctlr_api.read_all_controllers_xml(self.m_pyhouse_obj, self.m_xml.controller_sect, self.m_version)
     l_interface = interfaceXml.read_interface_xml(self.m_controller_obj, l_controllers[0])
Example #13
0
 def test_02_ExtractXML(self):
     l_controllers = self.m_ctlr_api.read_all_controllers_xml(self.m_pyhouse_obj)
     # print(PrettyFormatAny.form(l_controllers[0], 'A3-02-a - First Controller Obj'))
     l_interface = interfaceXml.read_interface_xml(self.m_controller_obj, l_controllers[0])