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

CATEGORY_LIGHTBULB configure_char('Brightness'... ValueError("Characteristic not found" #451

Open
AlexMaghen opened this issue Aug 5, 2023 · 1 comment

Comments

@AlexMaghen
Copy link

Thanks for this wonderful library. I am trying to build a LightBulb accessory that can handle dimming. For some reason, I get an error in __init__ when I try to do
self.char_brightness = serv_light.configure_char('Brightness', value=100)
The error comes back
ValueError: Characteristic not found

(extremely simple full accessory file attached)

Any help MOST appreciated. This is driving me nuts! :)
HKPoolDial.txt

@cerahmed
Copy link

Brightness is an optional charactarestic to LightBulb service (see below excerpt from pyhap/resources/services.json), meaning it's not attached to the service by default:

   "Lightbulb": {
      "OptionalCharacteristics": [
         "Brightness",
         "Hue",
         "Saturation",
         "Name",
         "ActiveTransitionCount",
         "TransitionControl",
         "SupportedTransitionConfiguration"
      ],
      "RequiredCharacteristics": [
         "On"
      ],
      "UUID": "00000043-0000-1000-8000-0026BB765291"
   },

Hence, in order to be able to configure brightnes, you should specify it in the initialization of the LightBulb service as following:

self.light_bulb_service = self.add_preload_service('LightBulb', chars=['Brightness'])

Then proceed with configuring the brightness charactarestic as you've done.

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

No branches or pull requests

2 participants