-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: develop
Are you sure you want to change the base?
Conversation
db9c508
to
17ffc04
Compare
There was a problem hiding this 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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
framework/core/logModule.py
Outdated
@@ -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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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. |
Moved stream handling to it's own module and added a receiveMessage method to hdmiCECController
fc14435
to
f25a966
Compare
|
||
def listDevices(self) -> list: | ||
self.stop() | ||
self._console.write(f'echo "scan" | cec-client -s {self.adaptor} -d 1 > cec-test.txt') |
There was a problem hiding this comment.
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
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