From 9f58795360fd525c9fe016d0f8d61f31f999a3e8 Mon Sep 17 00:00:00 2001 From: tamilarasi-t12 Date: Thu, 5 Dec 2024 14:44:33 +0530 Subject: [PATCH] Fix #119: Updated the changes --- framework/core/commonRemote.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/framework/core/commonRemote.py b/framework/core/commonRemote.py index 3d2875e..be7ae4b 100644 --- a/framework/core/commonRemote.py +++ b/framework/core/commonRemote.py @@ -76,7 +76,7 @@ def getMappedKey(self, key:str): prefix = self.currentMap.get("prefix") returnedKey=self.currentMap["codes"].get(key) if prefix: - returnedKey = prefix + returnedKey + returnedKey = prefix + key return returnedKey def getKeyMap(self): @@ -153,7 +153,15 @@ def __decodeRemoteMapConfig(self): with open(configFile) as inputFile: inputFile.seek(0, os.SEEK_SET) config = yaml.full_load(inputFile) - return config.get("remoteMaps", []) + keyDictionary = {} + for key, val in config.items(): + if isinstance(val, dict): + for k, v in val.items(): + keyDictionary[k] = v + else: + keyDictionary[key] = val + + return keyDictionary.get("remoteMaps") def sendKey(self, keycode:dict, delay:int=1, repeat:int=1, randomRepeat:int=0): """Send a key to the remoteCommander @@ -188,4 +196,4 @@ def setKeyMap( self, name:dict ): def getKeyMap( self ): """Get the Key Translation Map """ - return self.remoteMap.getKeyMap() + self.remoteMap.getKeyMap()