Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #103: Creation of remote hdmicec client #115

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

TB-1993
Copy link
Contributor

@TB-1993 TB-1993 commented Nov 7, 2024

Created new remote-cec-client hdmi cec controller.
Also added a threaded logging function to allow the logModule to write a continuous log stream out to a file.

closes #107

@TB-1993 TB-1993 requested a review from zghp November 7, 2024 16:40
@TB-1993 TB-1993 self-assigned this Nov 7, 2024
@TB-1993 TB-1993 force-pushed the feature/gh103_create_remote_cec-client branch from db9c508 to 17ffc04 Compare November 7, 2024 16:44
@TB-1993 TB-1993 requested a review from Ulrond November 8, 2024 10:21
@TB-1993 TB-1993 linked an issue Nov 8, 2024 that may be closed by this pull request
@TB-1993 TB-1993 added the enhancement New feature or request label Nov 8, 2024
Copy link
Collaborator

@Ulrond Ulrond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mentioned that your using the cecClient on a pi, where's that?

I don't see any mentioned of that or how it's used, and what it's got todo with a PI.? Isn't it just a client of cecClient, and you can do that on a PI or something else that has HDMI in.

@@ -163,41 +162,25 @@ def _splitDeviceSectionsToDicts(self,command_output:str) -> list:

def startMonitoring(self, monitoringLog: str, device_type: MonitoringType = MonitoringType.RECORDER) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that seems super complex for a param, I would say that's an internal requirement and fixed, not something that should be configured.

import logging
from threading import Thread
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there no changes to requriements.txt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

threading is standard library, so we're all good here.

@@ -486,4 +489,57 @@ def stepResult(self, result, message):
message = "[{}]: RESULT : [{}]: {}".format(self.stepNum,resultMessage, message)
self.step("=====================Step End======================",showStepNumber=False)
self.stepResultMessage(message)


def logStreamToFile(self, inputStream: IOBase, outFileName: str) -> None:
Copy link
Collaborator

@Ulrond Ulrond Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh?

There's no change to logging to support this.

need to revisit the design, doesn't look correct

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is outside of the scope for logModule.

This is an stream input class, that can write to files., I can't see it being related to logModule()

it uses logModule for writing data to logs, nothing todo with the module though, it's a user of logModule()

Starts monitoring CEC messages with a specified device type.

Args:
deviceType (MonitoringType, optional): The type of device to monitor (default: MonitoringType.RECORDER).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's outside of scope of the user of the API to know anything about what's under it, and what type of device you need to control , or how it's monitored.

device['active source'] = False
return devices

def startMonitoring(self, monitoringLog: str, deviceType: MonitoringType=MonitoringType.RECORDER) -> None:
Copy link
Collaborator

@Ulrond Ulrond Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't see any caller to this module? Where is it linked to anything about it?

the module needs to monitor when launched.. it's not an option, it's a requirement for it's usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No you can't monitor and send messages from the same module, monitoring is blocking. So you'd need to decide what you want to do with the device in the test.

@TB-1993
Copy link
Contributor Author

TB-1993 commented Dec 18, 2024

The new versions of these still have issues, the remoteCECClient isn't consistent due to the implementation of the readUntil in the sshConsole. I'll raise a bug ticket to get this fixed.

@TB-1993 TB-1993 force-pushed the feature/gh103_create_remote_cec-client branch from fc14435 to f25a966 Compare December 19, 2024 09:15

def listDevices(self) -> list:
self.stop()
self._console.write(f'echo "scan" | cec-client -s {self.adaptor} -d 1 > cec-test.txt')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Writing it to a file is definitely wrong

retries

Corrected hdmiController code to consistently use streamToFile's
readUnitl method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: hdmiCecController.py fails to be included when core is used in ut-raft
2 participants