|
@@ -103,6 +103,7 @@ class ground_floor_west_dirk(room):
|
103
|
103
|
AUDIO_SOURCE_PC = 0
|
104
|
104
|
AUDIO_SOURCE_CD = 1
|
105
|
105
|
AUDIO_SOURCE_RASPI = 2
|
|
106
|
+ AUDIO_SOURCE_PHONO = 3
|
106
|
107
|
|
107
|
108
|
def __init__(self, mqtt_client, pd, vd):
|
108
|
109
|
roo = props.ROO_DIR
|
|
@@ -116,6 +117,7 @@ class ground_floor_west_dirk(room):
|
116
|
117
|
# powerplug
|
117
|
118
|
self.powerplug_common = pd.get(props.STG_MYA, loc, roo, props.FUN_MPP)
|
118
|
119
|
self.KEY_POWERPLUG_AMPLIFIER = self.powerplug_common.KEY_OUTPUT_0
|
|
120
|
+ self.KEY_POWERPLUG_PHONO = self.powerplug_common.KEY_OUTPUT_1
|
119
|
121
|
self.KEY_POWERPLUG_CD_PLAYER = self.powerplug_common.KEY_OUTPUT_2
|
120
|
122
|
# dock
|
121
|
123
|
self.dock_tradfri = pd.get(props.STG_ZGW, loc, roo, props.FUN_DCK)
|
|
@@ -156,6 +158,7 @@ class ground_floor_west_dirk(room):
|
156
|
158
|
self.dock_tradfri.toggle_output_0_mcb)
|
157
|
159
|
|
158
|
160
|
# Mediaplayer - Amplifier auto on
|
|
161
|
+ self.powerplug_common.add_callback(self.KEY_POWERPLUG_PHONO, None, self.powerplug_common.set_output_0_mcb, True)
|
159
|
162
|
self.powerplug_common.add_callback(self.KEY_POWERPLUG_CD_PLAYER, None, self.powerplug_common.set_output_0_mcb, True)
|
160
|
163
|
self.spotify_state.add_callback(self.spotify_state.KEY_STATE, None, self.powerplug_common.set_output_0_mcb, True)
|
161
|
164
|
self.mpd_state.add_callback(self.mpd_state.KEY_STATE, None, self.powerplug_common.set_output_0_mcb, True)
|
|
@@ -163,6 +166,7 @@ class ground_floor_west_dirk(room):
|
163
|
166
|
# Mediaplayer - Audio source selection
|
164
|
167
|
self.powerplug_common.add_callback(self.KEY_POWERPLUG_AMPLIFIER, True, self.audio_source_selector, True)
|
165
|
168
|
self.powerplug_common.add_callback(self.KEY_POWERPLUG_CD_PLAYER, True, self.audio_source_selector, True)
|
|
169
|
+ self.powerplug_common.add_callback(self.KEY_POWERPLUG_PHONO, True, self.audio_source_selector, True)
|
166
|
170
|
self.spotify_state.add_callback(self.spotify_state.KEY_STATE, True, self.audio_source_selector, True)
|
167
|
171
|
self.mpd_state.add_callback(self.mpd_state.KEY_STATE, True, self.audio_source_selector, True)
|
168
|
172
|
self.bt_state.add_callback(self.bt_state.KEY_STATE, True, self.audio_source_selector, True)
|
|
@@ -195,6 +199,10 @@ class ground_floor_west_dirk(room):
|
195
|
199
|
mqtt_client, config.TOPIC_GFW_DIRK_AMPLIFIER_VIDEV,
|
196
|
200
|
self.powerplug_common, self.KEY_POWERPLUG_AMPLIFIER
|
197
|
201
|
)
|
|
202
|
+ self.phono_videv = videv_switching(
|
|
203
|
+ mqtt_client, config.TOPIC_GFW_DIRK_PHONO_VIDEV,
|
|
204
|
+ self.powerplug_common, self.KEY_POWERPLUG_PHONO
|
|
205
|
+ )
|
198
|
206
|
self.cd_player_videv = videv_switching(
|
199
|
207
|
mqtt_client, config.TOPIC_GFW_DIRK_CD_PLAYER_VIDEV,
|
200
|
208
|
self.powerplug_common, self.KEY_POWERPLUG_CD_PLAYER
|
|
@@ -224,6 +232,9 @@ class ground_floor_west_dirk(room):
|
224
|
232
|
if device == self.powerplug_common and key == self.KEY_POWERPLUG_CD_PLAYER:
|
225
|
233
|
# switch on of cd player
|
226
|
234
|
self.audio_source = self.AUDIO_SOURCE_CD
|
|
235
|
+ elif device == self.powerplug_common and key == self.KEY_POWERPLUG_PHONO:
|
|
236
|
+ # switch on of phono
|
|
237
|
+ self.audio_source = self.AUDIO_SOURCE_PHONO
|
227
|
238
|
elif device in [self.spotify_state, self.mpd_state, self.bt_state]:
|
228
|
239
|
# switch on raspi-source
|
229
|
240
|
self.audio_source = self.AUDIO_SOURCE_RASPI
|
|
@@ -238,6 +249,9 @@ class ground_floor_west_dirk(room):
|
238
|
249
|
elif self.audio_source == self.AUDIO_SOURCE_CD:
|
239
|
250
|
logger.info("Sending IR command to change audio source to cd")
|
240
|
251
|
self.remote_amplifier.set_cd()
|
|
252
|
+ elif self.audio_source == self.AUDIO_SOURCE_PHONO:
|
|
253
|
+ logger.info("Sending IR command to change audio source to phono")
|
|
254
|
+ self.remote_amplifier.set_line2()
|
241
|
255
|
elif self.audio_source == self.AUDIO_SOURCE_RASPI:
|
242
|
256
|
logger.info("Sending IR command to change audio source to raspi")
|
243
|
257
|
self.remote_amplifier.set_line1()
|