Skip to content

Commit 78b6b6a

Browse files
committed
Merge branch 'release/1.8.1'
2 parents 31bc5b8 + 515826c commit 78b6b6a

File tree

14 files changed

+511
-46
lines changed

14 files changed

+511
-46
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,31 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7+
#### [1.8.1](https://github.com/rdkcentral/python_raft/compare/1.8.0...1.8.1)
8+
9+
- Fix #201: Corrected typo in variable name [`#202`](https://github.com/rdkcentral/python_raft/pull/202)
10+
- Merge pull request #202 from rdkcentral/feature/gh201_correct_redrat_variable_name_network_ip [`#201`](https://github.com/rdkcentral/python_raft/issues/201)
11+
- Fix #201: Corrected typo in variable name [`#201`](https://github.com/rdkcentral/python_raft/issues/201)
12+
13+
#### [1.8.0](https://github.com/rdkcentral/python_raft/compare/1.7.1...1.8.0)
14+
15+
> 2 December 2025
16+
17+
- gh #199 Downgraded numpy to 1.26.4 to match the opencv [`#200`](https://github.com/rdkcentral/python_raft/pull/200)
18+
- gh#197: Add Virtual HDMI-CEC client [`#198`](https://github.com/rdkcentral/python_raft/pull/198)
19+
- Denon AVR get_audio_format from webAPI [`#196`](https://github.com/rdkcentral/python_raft/pull/196)
20+
- gh #192 updated the tapo multi power switch changes [`#194`](https://github.com/rdkcentral/python_raft/pull/194)
21+
- gh #197: Add Virtual HDMI-CEC client [`b2a951e`](https://github.com/rdkcentral/python_raft/commit/b2a951ec455f14028f93f82f4167e5d9a7612a49)
22+
- gh #197: Add Virtual HDMI-CEC client [`6e51ea2`](https://github.com/rdkcentral/python_raft/commit/6e51ea2e5f46a53469925df67e58d428fd361df9)
23+
- denon_get_audio_format [`f9cd69e`](https://github.com/rdkcentral/python_raft/commit/f9cd69ebe208b7f98085158aa8b1d11b878b3dc4)
24+
725
#### [1.7.1](https://github.com/rdkcentral/python_raft/compare/1.7.0...1.7.1)
826

27+
> 3 October 2025
28+
929
- Deploy cla action [`#187`](https://github.com/rdkcentral/python_raft/pull/187)
1030
- Fix #188 - Corrected requirements for python3.10 [`#188`](https://github.com/rdkcentral/python_raft/issues/188)
31+
- Bumped changelog [`3da8390`](https://github.com/rdkcentral/python_raft/commit/3da8390656c8e748c00c44a141e51a75e83e3aef)
1132
- Merge tag '1.7.0' into develop [`7fbd695`](https://github.com/rdkcentral/python_raft/commit/7fbd6950e8b9aee16cdc91dec323f53a240831c1)
1233

1334
#### [1.7.0](https://github.com/rdkcentral/python_raft/compare/1.6.0...1.7.0)

examples/configs/example_rack_config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ rackConfig:
9191
# [type: "tapo", ip: "", username: "", password: "", outlet: "optional"]
9292
# [type: "hs100", ip:"", port:"optional" ] kara also supports hs100
9393
# [type: "apc", ip:"", username:"", password:"" ] rack apc switch
94-
# [type: "olimex", ip:"", port:"optional", relay:"" ]
94+
# [type: "olimex", ip:"", port:"optional", relay:"" ]
9595
# [type: "SLP", ip:"", username: "", password: "", outlet_id:"", port:"optional"]
9696
# [type: "none" ] if section doesn't exist then type:none will be used
9797

98-
# [ hdmiCECController: optional ] - Specific hdmiCECController for the slot
98+
# [ hdmiCECController: optional ] - Specifies hdmiCECController for the slot
9999
# supported types:
100100
# [type: "cec-client", adaptor: "/dev/ttycec"]
101101
# [type: "remote-cec-client", adaptor: "/dev/ttycec", address: "192.168.99.1", username(optional): "testuser", password(optional): "testpswd", port(optional): "22"]
102-
102+
# [type: "virtual-cec-client", address: "127.0.0.1", username: "testuser", password: "testpswd", port: "5522", control_port: 8080, device_network_configuration: "path to device network configuration file" ]
103103
# [ avSyncController: optional] - Specifiec AVSyncController for the slot
104104
# supported types:
105105
# [type: "SyncOne2", port: "/dev/ttyACM0", extended_mode (optional): true|false, audio_input (optional): "AUTO|EXTERNAL|INTERNAL", speaker_distance (optional): "1.5"]

framework/core/audioAmplifier/base.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,12 @@ def get_status(self) -> dict:
105105
:return: Dictionary of current amplifier state.
106106
"""
107107
pass
108+
109+
@abstractmethod
110+
def get_audio_format(self) -> str:
111+
"""
112+
Get a string of audio format information.
113+
114+
:return: String of audio format like Dolby Atmos or PCM
115+
"""
116+
pass

framework/core/audioAmplifier/denon_controller.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import asyncio
2+
3+
import requests
4+
from defusedxml import DefusedXmlException
5+
from defusedxml.ElementTree import fromstring
26
from denonavr import DenonAVR
37
from .base import AudioAmplifier
48

59
class DenonAVRController(AudioAmplifier):
610

7-
def __init__(self, host: str):
11+
def __init__(self, host: str, port: int = 10443):
812
self.receiver = DenonAVR(host)
13+
self.url = f"https://{host}:{port}/"
914
self.setup()
1015

1116
def setup(self):
@@ -76,3 +81,28 @@ def get_status(self):
7681
"input": self.get_input(),
7782
"sound_mode": self.get_sound_mode(),
7883
}
84+
85+
def get_audio_format(self):
86+
"""
87+
Web interface was showing input audio format. Could not find an equivalent method from
88+
denonavr package. We need to get the inputSignal details, Searched whole package to find
89+
any reference of inputSignal, but could not find. So using the web api itself here.
90+
91+
Returns:
92+
str: 'Dolby Atmos', 'PCM'
93+
Raises:
94+
ValueError: if could not find or parse the data
95+
"""
96+
try:
97+
# The 'type=12' query parameter requests the configuration from the Denon AVR.
98+
# the certificates in denon avr showed expired even after firmware update. so added verify=False
99+
response = requests.get(f'{self.url}ajax/general/get_config?type=12', verify=False, timeout=15)
100+
if response.status_code == 200:
101+
xml_data = fromstring(response.content)
102+
element = xml_data.find(".//InputSignal")
103+
return element.text if element is not None else None
104+
raise ValueError(f"Failed to fetch Audio format. Status code: {response.status_code}")
105+
except DefusedXmlException:
106+
raise ValueError("Failed to parse AVR response.")
107+
except requests.exceptions.RequestException:
108+
raise ValueError("Can't reach AVR. Please check configuration")

framework/core/audioAmplifierController.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,7 @@ def get_sound_mode(self) -> str:
9696
def get_status(self):
9797
self._log.info("Getting audio amplifier status")
9898
return self.audioAmplifier.get_status()
99+
100+
def get_audio_format(self) -> str:
101+
self._log.info("Getting audio format")
102+
return self.audioAmplifier.get_audio_format()

framework/core/hdmiCECController.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
from framework.core.logModule import logModule
4040
from framework.core.streamToFile import StreamToFile
4141
from framework.core.hdmicecModules import CECClientController, RemoteCECClient, CECDeviceType
42+
from framework.core.hdmicecModules.virtualCECController import virtualCECController
4243

4344
class HDMICECController():
4445
"""
@@ -72,6 +73,17 @@ def __init__(self, log: logModule, config: dict):
7273
password=config.get('password',''),
7374
port=config.get('port',22),
7475
prompt=config.get('prompt', ':~'))
76+
elif self.controllerType.lower() == 'virtual-cec-client':
77+
self.controller = virtualCECController(self.cecAdaptor,
78+
self._log,
79+
self._stream,
80+
address=config.get('address'),
81+
username=config.get('username',''),
82+
password=config.get('password',''),
83+
port=config.get('port',22),
84+
prompt=config.get('prompt', '~#'),
85+
device_configuration=config.get('device_network_configuration',''),
86+
control_port=config.get('control_port', 8080))
7587
self._read_line = 0
7688

7789
def sendMessage(self, sourceAddress: str, destAddress: str, opCode: str, payload: list = None) -> None:

framework/core/hdmicecModules/abstractCECController.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __init__(self, adaptor_path:str, logger:logModule, streamLogger: StreamToFil
4949
def sendMessage(cls, sourceAddress: str, destAddress: str, opCode: str, payload: list = None, deviceType: CECDeviceType=None) -> None:
5050
"""
5151
Sends an opCode from a specified source and to a specified destination.
52-
52+
5353
Args:
5454
sourceAddress (str): The logical address of the source device (0-9 or A-F).
5555
destAddress (str): The logical address of the destination device (0-9 or A-F).
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#** *****************************************************************************
2+
# *
3+
# * If not stated otherwise in this file or this component's LICENSE file the
4+
# * following copyright and licenses apply:
5+
# *
6+
# * Copyright 2025 RDK Management
7+
# *
8+
# * Licensed under the Apache License, Version 2.0 (the "License");
9+
# * you may not use this file except in compliance with the License.
10+
# * You may obtain a copy of the License at
11+
# *
12+
# *
13+
# * http://www.apache.org/licenses/LICENSE-2.0
14+
# *
15+
# * Unless required by applicable law or agreed to in writing, software
16+
# * distributed under the License is distributed on an "AS IS" BASIS,
17+
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# * See the License for the specific language governing permissions and
19+
# * limitations under the License.
20+
# *
21+
#** ******************************************************************************
22+
HdmiCec:
23+
command: print
24+
description: Print the current HDMI CEC device map

0 commit comments

Comments
 (0)