Skip to content

Commit

Permalink
Fix in code logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Serios committed Aug 5, 2019
1 parent 9421f63 commit dd7738e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions custom_components/varna_public_transport/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ def device_state_attributes(self):

attr['lines'] = lines_count
i += 1
else:
attr['stop_lines'] = {}
attr['lines'] = 0

if self._mode == 'schedule' or self._mode == 'all':

Expand Down Expand Up @@ -201,6 +204,9 @@ def device_state_attributes(self):

attr['lines_schedules'] = schedules_lines_count
i += 1
else:
attr['stop_lines_schedules'] = {}
attr['lines_schedules'] = 0

_LOGGER.debug(attr)
return attr
Expand Down

0 comments on commit dd7738e

Please sign in to comment.