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

Array in custom characteristic #61

Open
Julius-Bendt opened this issue Oct 28, 2023 · 0 comments
Open

Array in custom characteristic #61

Julius-Bendt opened this issue Oct 28, 2023 · 0 comments
Labels
question Further information is requested

Comments

@Julius-Bendt
Copy link

Julius-Bendt commented Oct 28, 2023

Describe Your Problem:
I'm trying to create a custom characteristic that shows an array of string.
I'm using the home+ 6 app, which are able to show custom characteristics.

I've created the characteristic based on this issue: #20 (as linked in the README file)

I'm able get the custom characteristic to show, but only if I'm not using the "array" format

I've tried to lookup how saturation in the lightbulb works, however I could only find the definitions.

Code:

import { Formats, Perms, CharacteristicProps } from 'homebridge';

export = (homebridge) => {
  const Charact = homebridge.hap.Characteristic;

  return class EffectCharacteristic extends Charact {
    public static readonly UUID: string = 'f8d871fa-a67a-43fe-872d-5250f055d17c';
      constructor() {
          
        const options: CharacteristicProps = {
            format: Formats.ARRAY, // UINT16 works
            unit: '',
            validValues: [0,1,2,3,4,5,6,7], // Also tried with strings. Removing this allows the accessory to be shown, but not edited
            perms: [Perms.PAIRED_READ, Perms.NOTIFY],
        }
        
        super('Effect', EffectCharacteristic.UUID, options);
        this.value = 0; // And with a string down here
    }
  };
};

Github repo:
https://github.com/Julius-Bendt/homebridge-hyperion

Logs:
None - no errors thrown

Plugin Config:

{
    "name": "HyperionJub",
    "url": "http://192.168.1.107",
    "port": "8090",
    "priority": 50,
    "platform": "HyperionJub"
}

Screenshots:

image

Environment:

  • Plugin Version:
  • Homebridge Version: 1.6.1
  • Node.js Version: 18.17.1
  • NPM Version: 10.0.0
  • Operating System: Windows
@Julius-Bendt Julius-Bendt added the question Further information is requested label Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant