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

[Bug]: Incorrect attribute error but attribute is on the list of supported attributes in the message. #456

Closed
sjorge opened this issue Nov 14, 2021 · 5 comments
Assignees
Labels
bug 🐛 There is at least high chance that it is a bug!

Comments

@sjorge
Copy link

sjorge commented Nov 14, 2021

NRCHKB Plugin Version

1.4.3

Node JS Version

16.13.0

NPM Version

8.1.0

Node-RED Version

2.0.6

Operating System

OmniOS r151041

What happened?

When sending a update that contains LockPhysicalControls to an AirPurifier service it complains about the characteristic not being supported, but according to HAP-NodeJS it is and it's also listed in the actual error as supported.

Screen Shot 2021-11-14 at 14 46 45

The service has the follow

{
    "Active": true,
    "CurrentAirPurifierState": true,
    "TargetAirPurifierState": true,
    "LockPhysicalControls": true,
    "RotationSpeed": {
        "minValue": 0,
        "maxValue": 9
    }
}

How to reproduce?

Send a the following payload to an AirPurifier service:

{"LockPhysicalControls ":0,"Active":1,"CurrentAirPurifierState":2,"TargetAirPurifierState":1,"RotationSpeed":1}

Expected behavior:

LockPhysicalControls to be accepted for an AirPurifier service as per the definition in https://github.com/homebridge/HAP-NodeJS/blob/43c0143db22cf6c1285cdef15d70adf546a34687/src/lib/definitions/ServiceDefinitions.ts#L117

Additional comments?

No response

Relevant log output

Instead of LockPhysicalControls  try one of these characteristics: Name, Active, CurrentAirPurifierState, TargetAirPurifierState, LockPhysicalControls, RotationSpeed, LockPhysicalControls, Name, RotationSpeed, SwingMode

I'm guessing something is going wrong somewhere as LockPhysicalControls also appears twice in the error.

@sjorge sjorge added the bug 🐛 There is at least high chance that it is a bug! label Nov 14, 2021
@crxporter
Copy link
Member

Do you have a trailing space in "LockPhysicalControls "

it looks like some places you have a whitespace in there.

@crxporter
Copy link
Member

Did you put it with the extra whitespace character in your characteristic properties? That could make it appear twice in the list of chars to use.

@sjorge
Copy link
Author

sjorge commented Nov 14, 2021

Well that was embarrassing, especially since I spend most of yesterday looking into this error before giving up and filing a ticket.

I just delete and recreated the character properties from scratch, I was not seeing a space so it might have been some sort of random control character that snuck in.

@sjorge sjorge closed this as completed Nov 14, 2021
@crxporter
Copy link
Member

Well it's still interesting, I would have expected the whitespace to be removed with the regex filter which should be running on the char props... reaching out to @Shaquu to see if there's some reason the regex ignores the last character of that string?

@Shaquu
Copy link
Member

Shaquu commented Nov 14, 2021

@sjorge no need for embarrassment. As discussed with @crxporter error will be a little more descriptive from now on.

image

Shaquu added a commit that referenced this issue Nov 20, 2022
### Added

- Support for new advertiser [AVAHI](homebridge/HAP-NodeJS#918)
- Support for new advertiser [RESOLVED](homebridge/HAP-NodeJS#965)
- Added `msg.hap.reachable` parameter to get device reachable state (related to NO_RESPONSE)

### Fixed

- Accessory could not be recovered from NO_RESPONSE using single Characteristic
- Make unsupported Characteristic error more
  descriptive [#456](#456)
- FFmpeg No such file or directory [#495](#495)
- allChars: properties have spaces in names [#496](#496)
- Wait for host to return from unpublish/destroy before exiting, set published flag on destroy
- Security system with characteristics, bad behaviour [#388](#388)

### Changed

- Updated hap-nodejs to [0.9.7](https://github.com/homebridge/HAP-NodeJS/releases/tag/v0.9.7) (bug fixes)
- Updated hap-nodejs to [0.9.8](https://github.com/homebridge/HAP-NodeJS/releases/tag/v0.9.8) (bug fixes)
- Updated hap-nodejs to [0.10.0](https://github.com/homebridge/HAP-NodeJS/releases/tag/v0.10.0) (features)
- Updated hap-nodejs to [0.10.1](https://github.com/homebridge/HAP-NodeJS/releases/tag/v0.10.1) (changes)
- Updated hap-nodejs to [0.10.2](https://github.com/homebridge/HAP-NodeJS/releases/tag/v0.10.2) (bug fixes)
- Updated hap-nodejs to [0.10.3](https://github.com/homebridge/HAP-NodeJS/releases/tag/v0.10.3) (bug fixes)
- Updated hap-nodejs to [0.10.4](https://github.com/homebridge/HAP-NodeJS/releases/tag/v0.10.4) (bug fixes)
- Updated hap-nodejs to [0.11.0](https://github.com/homebridge/HAP-NodeJS/releases/tag/v0.11.0) (features and bug fixes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 There is at least high chance that it is a bug!
Projects
None yet
Development

No branches or pull requests

3 participants