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

ut_control: ut_kvp: upgrade to support yaml validation #8

Open
Ulrond opened this issue May 8, 2024 · 1 comment
Open

ut_control: ut_kvp: upgrade to support yaml validation #8

Ulrond opened this issue May 8, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Ulrond
Copy link
Collaborator

Ulrond commented May 8, 2024

Using this as an example is it possible to validate input yaml files?

hdmicec:
  device_type: &device_type # List of allowed values
    - TV
    - STB_1
    - STB_2 
    - DVR_1
    - DVR_2
    - Chromecast
    - HomeTheatre
    - GamingConsole_1
    - GamingConsole_2
    - DVDPlayer_1
    - DVDPlayer_2
    - AVR_1
    - AVR_2
    - Switcher_1
    - Switcher_2
    - Camera_1
    - Camera_2
    - SpecialPurpose_1
    - SpecialPurpose_2
    - Unregistered_1
    - Unregistered_2

  port_id: &port_id # List of allowed types
    !!int
  port_type: &port_type # List of allowed values
    - in
    - out

  vendor: &vendor # List of allowed values
    - [TOSHIBA, 0x000039]
    - [SAMSUNG, 0x0000F0]
    - [DENON, 0x0005CD]
    - [MARANTZ, 0x000678]
    - [LOEWE, 0x000982]
    - [ONKYO, 0x0009B0]
    - [MEDION, 0x000CB8]
    - [TOSHIBA2, 0x000CE7]
    - [APPLE, 0x0010FA]
    - [HARMAN_KARDON2, 0x001950]
    - [GOOGLE, 0x001A11]
    - [AKAI, 0x0020C7]
    - [AOC, 0x002467]
    - [PANASONIC, 0x008045]
    - [PHILIPS, 0x00903E]
    - [DAEWOO, 0x009053]
    - [YAMAHA, 0x00A0DE]
    - [GRUNDIG, 0x00D0D5]
    - [PIONEER, 0x00E036]
    - [LG, 0x00E091]
    - [SHARP, 0x08001F]
    - [SONY, 0x080046]
    - [BROADCOM, 0x18C086]
    - [SHARP2, 0x534850]
    - [VIZIO, 0x6B746D]
    - [BENQ, 0x8065E9]
    - [HARMAN_KARDON, 0x9C645E]
    - [UNKNOWN, 0]

  cec_version: &cec_version # List of allowed values
    - 0  #Unknown
    - 1  rdkcentral/ut-core#1.2
    - 2  rdkcentral/ut-core#1.2A
    - 3  rdkcentral/ut-core#1.3
    - 4  rdkcentral/ut-core#1.3A
    - 5  rdkcentral/ut-core#1.4
    - 6  rdkcentral/ut-core#2.0

  power_status: &power_status # List of allowed values
    - on
    - off
    - standby

  endpoint: &endpoint
    name: !!str
    id: *port_id # One option must be selected from the list
    type: *port_type # One option must be selected from the list

  link: &link
    - *endpoint
    - *endpoint  

  version: *cec_version
  type: *device_type # One option must be selected from the list
  active_source: !!bool
  vendor_info: *vendor # One option must be selected from the list
  pwr_status: *power_status # One option must be selected from the list
  name: !!str
  number_ports: !!int
  ports:
    - id: *port_id
      type: *port_type  # One option must be selected from the list
      cec_supported: !!bool
      arc_supported: !!bool
    - id: *port_id # One option must be selected from the list
      type: *port_type # One option must be selected from the list
      cec_supported: !!bool
      arc_supported: !!bool
  number_devices: !!int
  devices:
    - type: *device_type # One option must be selected from the list
      version: *cec_version # One option must be selected from the list
      active_source: !!bool
      vendor_info: *vendor # One option must be selected from the list
      pwr_status: *power_status # One option must be selected from the list
      name: !!str

    - type: *device_type
      version: *cec_version # One option must be selected from the list
      active_source: !!bool
      vendor_info: *vendor # One option must be selected from the list
      pwr_status: *power_status # One option must be selected from the list
      name: !!str

    - type: *device_type
      version: *cec_version # One option must be selected from the list
      active_source: !!bool
      vendor_info: *vendor # One option must be selected from the list
      pwr_status: *power_status # One option must be selected from the list
      name: !!str

    - type: *device_type
      version: *cec_version # One option must be selected from the list
      active_source: !!bool
      vendor_info: *vendor # One option must be selected from the list
      pwr_status: *power_status # One option must be selected from the list
      name: !!str

Here's a discussion topic on the subject.
https://blog.picnic.nl/how-to-use-yaml-schema-to-validate-your-yaml-files-c82c049c2097

@Ulrond Ulrond added the enhancement New feature or request label May 8, 2024
@Ulrond Ulrond assigned Ulrond and unassigned Ulrond May 13, 2024
@Ulrond Ulrond transferred this issue from rdkcentral/ut-core Jun 19, 2024
@Ulrond Ulrond changed the title ut_kvp: upgrade to support yaml validation ut_control: ut_kvp: upgrade to support yaml validation Jun 28, 2024
@Ulrond Ulrond added this to the 2.0.0 - Future Features milestone Jun 28, 2024
@Ulrond
Copy link
Collaborator Author

Ulrond commented Jun 28, 2024

  • discussion is currently that we don't think this is required.

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
Status: Todo
Development

No branches or pull requests

1 participant