Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions homeassistant/components/sensor/sonarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,12 @@ def device_state_attributes(self):
)
elif self.type == 'series':
for show in self.data:
attributes[show['title']] = '{}/{} Episodes'.format(
show['episodeFileCount'], show['episodeCount'])
if 'episodeFileCount' not in show

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace
SyntaxError: invalid syntax

or 'episodeCount' not in show:
attributes[show['title']] = 'N/A'
else:
attributes[show['title']] = '{}/{} Episodes'.format(
show['episodeFileCount'], show['episodeCount'])
elif self.type == 'status':
attributes = self.data
return attributes
Expand Down