Skip to content
Snippets Groups Projects
Commit 10b31454 authored by Auke Klazema's avatar Auke Klazema
Browse files

Task #9893: TriggerEmailService was not aware of the new dwelling time parameters

parent 0e6980a9
No related branches found
No related tags found
No related merge requests found
......@@ -239,18 +239,30 @@ class TriggerNotificationListener(AbstractBusListener):
start_times = doc.getroot().findall('specification/activity/observation/timeWindowSpecification/startTime')
start_time = datetime.strptime(start_times[0].text, '%Y-%m-%dT%H:%M:%S')
if start_times: # Not dwelling
start_time = datetime.strptime(start_times[0].text, '%Y-%m-%dT%H:%M:%S')
durations = doc.getroot().findall(
'specification/activity/observation/timeWindowSpecification/duration/duration')
durations = doc.getroot().findall(
'specification/activity/observation/timeWindowSpecification/duration/duration')
duration = durations[0].text
duration = durations[0].text
duration_seconds = self._iso8601_duration_as_seconds(duration)
duration_seconds = self._iso8601_duration_as_seconds(duration)
stop_time = start_time + timedelta(seconds=duration_seconds)
stop_time = start_time + timedelta(seconds=duration_seconds)
return start_time, stop_time
else: # Dwelling
min_start_times = doc.getroot().findall('specification/activity/observation/timeWindowSpecification/minStartTime')
min_start_time = datetime.strptime(min_start_times[0].text, '%Y-%m-%dT%H:%M:%S')
max_end_times = doc.getroot().findall('specification/activity/observation/timeWindowSpecification/maxEndTime')
max_end_time = datetime.strptime(max_end_times[0].text, '%Y-%m-%dT%H:%M:%S')
return min_start_time, max_end_time
return start_time, stop_time
def start_listening(self, **kwargs):
self.mom_rpc_client.open()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment