def _read_one_lighting_schedule(p_schedule_element): """Extract schedule information from a schedule xml element. """ l_obj = ScheduleLightData() l_obj.Level = PutGetXML.get_int_from_xml(p_schedule_element, 'Level') l_obj.LightName = PutGetXML.get_text_from_xml(p_schedule_element, 'LightName') l_obj.Rate = PutGetXML.get_int_from_xml(p_schedule_element, 'Rate') l_obj.RoomName = PutGetXML.get_text_from_xml(p_schedule_element, 'RoomName') return l_obj # for testing
def test_03_MessageObj(self): """ Add an object. """ l_data = ScheduleLightData() l_data.Name = 'Mqtt Controller Object' l_data.RoomName = 'Living Room' l_data.Comment = 'The formal Living Room.' l_message = _make_message(self.m_pyhouse_obj, l_data) # print(PrettyFormatAny.form(l_message, 'C2-03-A - Message', 80)) self.assertEqual(self.jsonPair(l_message, 'Sender'), self.m_pyhouse_obj.Computer.Name) self.assertSubstring('DateTime', l_message) self.assertEqual(self.jsonPair(l_message, 'Name'), l_data.Name)
def test_03_MessageObj(self): """ Add an object. """ l_data = ScheduleLightData() l_data.Name = 'Mqtt Controller Object' l_data.RoomName = 'Living Room' l_data.Comment = 'The formal Living Room.' l_message = Util._make_message(self.m_pyhouse_obj, l_data) # print(PrettyFormatAny.form(l_message, 'Message', 80)) self.assertEqual(self.jsonPair(l_message, 'Sender'), self.m_pyhouse_obj.Computer.Name) self.assertSubstring('DateTime', l_message) self.assertEqual(self.jsonPair(l_message, 'Name'), l_data.Name)
def _read_one_lighting_schedule(p_schedule_element): """Extract schedule information from a schedule xml element. """ l_obj = ScheduleLightData() l_obj = Xml._read_one_base_schedule(p_schedule_element) l_obj.Level = PutGetXML.get_int_from_xml(p_schedule_element, 'Level') l_obj.LightName = PutGetXML.get_text_from_xml(p_schedule_element, 'LightName') l_obj.LightUUID = PutGetXML.get_uuid_from_xml(p_schedule_element, 'LightUUID') l_obj.Rate = PutGetXML.get_int_from_xml(p_schedule_element, 'Rate') l_obj.RoomName = PutGetXML.get_text_from_xml(p_schedule_element, 'RoomName') l_obj.RoomUUID = PutGetXML.get_uuid_from_xml(p_schedule_element, 'RoomUUID') return l_obj # for testing