Fix: getter for Name Characteristic returned object instead of the value #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The latest 1.3.0 beta has some additional sanity checking when receiving values from plugins. One of them is if the type of the supplied value matches what the characteristic value expects.
With the latest 1.3.0 beta the following error message appeared (from those said sanity checks), as mentioned in #24 :
The problem was that the custom defined
getValue()
defined for theCharacteristic.Name
(as stated in the error message in the first line) didn't actually return the value itself. As it was annotated with async, it returned aPromise<string>
, which is internally aobject
as stated in the error message.This should mitigate the issue. And sorry for my false assumptions made in #24.
The rest of the code seemed okay, besides what I mentioned with the setting of props, but didn't want to go too deep into the project.