|
1 | 1 | """ |
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, ... |
3 | 4 | """ |
4 | 5 | import requests |
5 | 6 | from lxml import objectify |
6 | 7 |
|
| 8 | + |
7 | 9 | class FSAPI(object): |
8 | 10 |
|
9 | 11 | PLAY_STATES = { |
@@ -54,7 +56,7 @@ def call(self, path, extra=None): |
54 | 56 | def __del__(self): |
55 | 57 | self.call('DELETE_SESSION') |
56 | 58 |
|
57 | | - ### Handlers |
| 59 | + # Handlers |
58 | 60 |
|
59 | 61 | def handle_get(self, item): |
60 | 62 | return self.call('GET/{}'.format(item)) |
@@ -114,7 +116,7 @@ def collect_labels(self, items): |
114 | 116 |
|
115 | 117 | return [str(item['label']) for item in items if item['label']] |
116 | 118 |
|
117 | | - ### Properties |
| 119 | + # Properties |
118 | 120 | @property |
119 | 121 | def play_status(self): |
120 | 122 | status = self.handle_int('netRemote.play.status') |
@@ -144,9 +146,9 @@ def play_info_graphics(self): |
144 | 146 | def volume_steps(self): |
145 | 147 | return self.handle_int('netRemote.sys.caps.volumeSteps') |
146 | 148 |
|
147 | | - ### Read-write |
| 149 | + # Read-write |
148 | 150 |
|
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) |
150 | 152 | def play_control(self, value): |
151 | 153 | return self.handle_set('netRemote.play.control', value) |
152 | 154 |
|
@@ -214,7 +216,7 @@ def get_mode(self): |
214 | 216 | if temp_mode['band'] == int_mode: |
215 | 217 | mode = temp_mode['label'] |
216 | 218 |
|
217 | | - return mode |
| 219 | + return str(mode) |
218 | 220 |
|
219 | 221 | def set_mode(self, value): |
220 | 222 | mode = -1 |
|
0 commit comments