Skip to content

Commit d64badd

Browse files
committed
cleaned up code according to flake8 and added explicit string conversion for mode
1 parent a716e10 commit d64badd

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

fsapi/__init__.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
"""
2-
Support for interaction with Frontier Silicon Devices (Medion, Hama, Auna,...) devices.
2+
Support for interaction with Frontier Silicon Devices
3+
For example internet radios from: Medion, Hama, Auna, ...
34
"""
45
import requests
56
from lxml import objectify
67

8+
79
class FSAPI(object):
810

911
PLAY_STATES = {
@@ -54,7 +56,7 @@ def call(self, path, extra=None):
5456
def __del__(self):
5557
self.call('DELETE_SESSION')
5658

57-
### Handlers
59+
# Handlers
5860

5961
def handle_get(self, item):
6062
return self.call('GET/{}'.format(item))
@@ -114,7 +116,7 @@ def collect_labels(self, items):
114116

115117
return [str(item['label']) for item in items if item['label']]
116118

117-
### Properties
119+
# Properties
118120
@property
119121
def play_status(self):
120122
status = self.handle_int('netRemote.play.status')
@@ -144,9 +146,9 @@ def play_info_graphics(self):
144146
def volume_steps(self):
145147
return self.handle_int('netRemote.sys.caps.volumeSteps')
146148

147-
### Read-write
149+
# Read-write
148150

149-
#1=Play; 2=Pause; 3=Next (song/station); 4=Previous (song/station)
151+
# 1=Play; 2=Pause; 3=Next (song/station); 4=Previous (song/station)
150152
def play_control(self, value):
151153
return self.handle_set('netRemote.play.control', value)
152154

@@ -214,7 +216,7 @@ def get_mode(self):
214216
if temp_mode['band'] == int_mode:
215217
mode = temp_mode['label']
216218

217-
return mode
219+
return str(mode)
218220

219221
def set_mode(self, value):
220222
mode = -1

0 commit comments

Comments
 (0)