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

Add support for sending luna commands #9

Merged
merged 4 commits into from
Oct 7, 2024
Merged

Conversation

jonatino
Copy link
Contributor

@jonatino jonatino commented Oct 7, 2024

Luna commands are a lot more powerful and normally not exposed via the websocket api.

Example of use to change backlight levels:

const LUNA_SET_CONFIGS: &'static str = "com.webos.service.config/setConfigs";
const LUNA_SET_SYSTEM_SETTINGS: &'static str = "com.webos.settingsservice/setSystemSettings";
const LUNA_TURN_ON_SCREEN_SAVER: &'static str = "com.webos.service.tvpower/power/turnOnScreenSaver";
const LUNA_REBOOT_TV: &'static str = "com.webos.service.tvpower/power/reboot";
const LUNA_REBOOT_TV_WO4: &'static str = "com.webos.service.tv.power/reboot";
const LUNA_SHOW_INPUT_PICKER: &'static str = "com.webos.surfacemanager/showInputPicker";
const LUNA_SET_DEVICE_INFO: &'static str = "com.webos.service.eim/setDeviceInfo";
const LUNA_EJECT_DEVICE: &'static str = "com.webos.service.attachedstoragemanager/ejectDevice";
const LUNA_SET_TPC: &'static str = "com.webos.service.oledepl/setTemporalPeakControl";
const LUNA_SET_GSR: &'static str = "com.webos.service.oledepl/setGlobalStressReduction";
const LUNA_SET_WHITE_BALANCE: &'static str = "com.webos.service.pqcontroller/setWhiteBalance";

let category = "picture";

let params = json!(
 {
   "category": category,
   "settings": {
     "backlight": 50
   }
  }
);

client.send_luna_command(LUNA_SET_SYSTEM_SETTINGS, params).await.unwrap();

Copy link
Owner

@kziemianek kziemianek left a comment

Choose a reason for hiding this comment

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

Looks good, thank you 👍🏼

@kziemianek kziemianek merged commit e28b152 into kziemianek:main Oct 7, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants