-
Notifications
You must be signed in to change notification settings - Fork 0
WIP: Sony lcd #70
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
base: master
Are you sure you want to change the base?
WIP: Sony lcd #70
Changes from 5 commits
7f98c95
54df986
c714b8f
2a2c979
5bdaf81
90d9b61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| module Sony; end | ||
| module Sony::Display; end | ||
|
|
||
| # Documentation: https://docs.google.com/spreadsheets/d/1F8RyaDqLYlKBT7fHJ_PT7yHwH3vVMZue4zUc5McJVYM/edit?usp=sharing | ||
|
|
||
| class Sony::Display::CBX | ||
| include ::Orchestrator::Constants | ||
| include ::Orchestrator::Transcoder | ||
|
|
||
| # Discovery Information | ||
| tcp_port 4999 | ||
| descriptive_name 'Sony CBX Display' | ||
| generic_name :Display | ||
|
|
||
| def on_load | ||
| on_update | ||
| end | ||
|
|
||
| def on_update | ||
| end | ||
|
|
||
| def connected | ||
| schedule.every('60s') { power? } | ||
| end | ||
|
|
||
| def disconnected | ||
| schedule.clear | ||
| end | ||
|
|
||
| # | ||
| # Power commands | ||
| # | ||
| def power(state, opt = nil) | ||
|
jeremy-west marked this conversation as resolved.
Outdated
|
||
| if is_affirmative?(state) | ||
| send("8C 00 00 02 01 8F", hex_string: true) | ||
| logger.debug "-- sony display requested to power on" | ||
| else | ||
| send("8C 00 00 02 01 8F", hex_string: true) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the same hex string as the power on command. Is this a toggle?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We believe so, not 100% sure, hence added the else statement just to be sure.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The protocol doc in the comment at the top of this file makes reference to both power on and power off commands? Regardless, if only a toggle is supported, provide a |
||
| logger.debug "-- sony display requested to power off" | ||
| end | ||
|
|
||
| # Request status update | ||
| power? | ||
|
jeremy-west marked this conversation as resolved.
|
||
| end | ||
|
|
||
| def power?(options = {}) | ||
| options[:priority] = 0 | ||
| options[:hex_string] = true | ||
| send("83 00 00 FF FF 81", options) | ||
| end | ||
|
|
||
| def received(byte_str, resolve, command) # Data is default received as a string | ||
| logger.debug { "sony display sent: 0x#{byte_to_hex(byte_str)}" } | ||
| if byte_str.start_with?("\x70\x0\x0\x1") | ||
| self[:power] = true | ||
| elsif byte_str == "\x70\x0\x0\x0\x72" | ||
| self[:power] = false | ||
| end | ||
| :success | ||
| end | ||
| end | ||
Uh oh!
There was an error while loading. Please reload this page.