From 11444a115d54c110dee1967a4c58a5bd0ab06db3 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sun, 15 Jun 2025 15:28:51 +0200 Subject: [PATCH] Phono adaption gfw/dirk --- function/ground_floor_west.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/function/ground_floor_west.py b/function/ground_floor_west.py index 3031644..95b61df 100644 --- a/function/ground_floor_west.py +++ b/function/ground_floor_west.py @@ -116,6 +116,7 @@ class ground_floor_west_dirk(room): AUDIO_SOURCE_CD = 1 AUDIO_SOURCE_RASPI = 2 AUDIO_SOURCE_BT = 3 + AUDIO_SOURCE_PHONO = 4 def __init__(self, mqtt_client, pd, vd): roo = props.ROO_DIR @@ -181,6 +182,7 @@ class ground_floor_west_dirk(room): self.powerplug_common.add_callback(self.KEY_POWERPLUG_AMPLIFIER, True, self.audio_source_selector, True) self.powerplug_common.add_callback(self.KEY_POWERPLUG_CD_PLAYER, True, self.audio_source_selector, True) self.powerplug_common.add_callback(self.KEY_POWERPLUG_BT, True, self.audio_source_selector, True) + self.powerplug_common.add_callback(self.KEY_POWERPLUG_PHONO, True, self.audio_source_selector, True) self.spotify_state.add_callback(self.spotify_state.KEY_STATE, True, self.audio_source_selector, True) self.mpd_state.add_callback(self.mpd_state.KEY_STATE, True, self.audio_source_selector, True) self.bt_state.add_callback(self.bt_state.KEY_STATE, True, self.audio_source_selector, True) @@ -253,6 +255,9 @@ class ground_floor_west_dirk(room): elif device == self.powerplug_common and key == self.KEY_POWERPLUG_BT: # switch on of bluetooth self.audio_source = self.AUDIO_SOURCE_BT + elif device == self.powerplug_common and key == self.KEY_POWERPLUG_PHONO: + # switch on of bluetooth + self.audio_source = self.AUDIO_SOURCE_PHONO elif device in [self.spotify_state, self.mpd_state, self.bt_state]: # switch on raspi-source self.audio_source = self.AUDIO_SOURCE_RASPI @@ -268,8 +273,11 @@ class ground_floor_west_dirk(room): logger.info("Sending IR command to change audio source to cd") self.remote_amplifier.set_cd() elif self.audio_source == self.AUDIO_SOURCE_BT: - logger.info("Sending IR command to change audio source to tuner") + logger.info("Sending IR command to change audio source to bluetooth") self.remote_amplifier.set_line2() + elif self.audio_source == self.AUDIO_SOURCE_PHONO: + logger.info("Sending IR command to change audio source to phono") + self.remote_amplifier.set_phono() elif self.audio_source == self.AUDIO_SOURCE_RASPI: logger.info("Sending IR command to change audio source to raspi") self.remote_amplifier.set_line1()