Skip to content

Comments

Add picture quality settings and variables#71

Open
itota wants to merge 3 commits intobitfocus:masterfrom
itota:feature/picture-settings
Open

Add picture quality settings and variables#71
itota wants to merge 3 commits intobitfocus:masterfrom
itota:feature/picture-settings

Conversation

@itota
Copy link
Contributor

@itota itota commented Nov 16, 2025

Added actions, presets, and variables for picture quality settings.
I have implemented the numerically configurable targets among those available in the following API.
https://pro-bravia.sony.net/develop/integrate/rest-api/spec/service/video/v1_0/setPictureQualitySettings/index.html

  • Color
  • Brightness
  • Contrast
  • Sharpness

Copy link
Collaborator

@peternewman peternewman 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, a few relatively minor comments.

Any reason not to do the non-numeric settings too, or was it just simpler to start with these?

For similar elsewhere, I've also delivered feedbacks to match if it's at a specific value.

Comment on lines +38 to +41
color: NaN,
brightness: NaN,
contrast: NaN,
sharpness: NaN,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we make volumeLevel NaN too if this is the best bet? Or undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since 0 has meaning, I set it to NaN as the default value, but perhaps it should be undefined instead.

Copy link
Collaborator

Choose a reason for hiding this comment

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

undefined feels a better fit to me. Can you update volume too to match.

src/presets.js Outdated
Comment on lines 316 to 321
const PICTURE_PRESETS = [
{ id: 'color', label: 'Color', default: 50 },
{ id: 'brightness', label: 'Brightness', default: 40 },
{ id: 'contrast', label: 'Contrast', default: 90 },
{ id: 'sharpness', label: 'Sharpness', default: 50 },
]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this data should be duplicated here and in actions, it should just be set once somewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed it to use the data within actions.js.

PICTURE_SETTINGS.forEach((setting) => {
actions['set_' + setting.id] = {
name: setting.label,
options: [
Copy link
Collaborator

Choose a reason for hiding this comment

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

You may as well add the step setting they provide and populate the option with that too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, done.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was sort of meaning pull it out of their config via the API, but maybe that's more effort than it's worth.

name: setting.label,
options: [
{
type: 'number',
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know the right answer here, but whilst number is technically correct, it sadly currently excludes variable support, meaning people couldn't e.g. use this to set the value via a rotary encoder.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you think we should do?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Honestly I don't know, I think our three options are:

  1. Stay with number, nicer UI with steps and min/max
  2. Switch to text, can enable variables, but probably need external value validation
  3. Do both with some fancy switch and isVisible toggling of two different fields

Maybe 1 makes sense just to start going for now. I think Companion centrally may improve the behaviour around that soon (it's just a shame they haven't done so already...).

Copy link
Collaborator

@peternewman peternewman left a comment

Choose a reason for hiding this comment

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

Sorry I really suck at reviewing at the moment it seems.

Can you add some feedbacks too (using your new internal values).

Comment on lines +317 to +323
const PICTURE_SETTINGS = [
{ id: 'color', label: 'Color', default: 50 },
{ id: 'brightness', label: 'Brightness', default: 40 },
{ id: 'contrast', label: 'Contrast', default: 90 },
{ id: 'sharpness', label: 'Sharpness', default: 50 },
]

Copy link
Collaborator

Choose a reason for hiding this comment

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

Given we're now using the ones from actions:

Suggested change
const PICTURE_SETTINGS = [
{ id: 'color', label: 'Color', default: 50 },
{ id: 'brightness', label: 'Brightness', default: 40 },
{ id: 'contrast', label: 'Contrast', default: 90 },
{ id: 'sharpness', label: 'Sharpness', default: 50 },
]

down: [
{
actionId: 'set_' + setting.id,
options: { value: setting.default },
Copy link
Collaborator

Choose a reason for hiding this comment

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

I normally provide say 5 presets from 0-100 with those values in the option and on the button (plus the feedback to show they're selected). Personally for me this preset is a bit pointless on it's own (and hard to test as an end user, as nothing will change).

Comment on lines +38 to +41
color: NaN,
brightness: NaN,
contrast: NaN,
sharpness: NaN,
Copy link
Collaborator

Choose a reason for hiding this comment

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

undefined feels a better fit to me. Can you update volume too to match.

PICTURE_SETTINGS.forEach((setting) => {
actions['set_' + setting.id] = {
name: setting.label,
options: [
Copy link
Collaborator

Choose a reason for hiding this comment

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

I was sort of meaning pull it out of their config via the API, but maybe that's more effort than it's worth.

name: setting.label,
options: [
{
type: 'number',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Honestly I don't know, I think our three options are:

  1. Stay with number, nicer UI with steps and min/max
  2. Switch to text, can enable variables, but probably need external value validation
  3. Do both with some fancy switch and isVisible toggling of two different fields

Maybe 1 makes sense just to start going for now. I think Companion centrally may improve the behaviour around that soon (it's just a shame they haven't done so already...).

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