ONVIF/HomeKit: all-digit serial numbers stored as number, HAP warns "number instead of string"
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Start with onvif/src/main.ts at lines 57 and 485, then inspect homekit/src/info.ts at line 13 and the onvif dependency behavior described for lib/utils.js:35. Trace how serialNumber reaches HomeKit and ensure all-digit serials remain strings, then verify the warning no longer occurs when adding the described Tapo cameras.
Written by the indexing model from the issue text.
Description
Describe the bug
ONVIF cameras with all-digit serial numbers log this in the HomeKit plugin on every start:
[Tapo C200@@Serial Number] characteristic was supplied illegal value: number instead of string, supplying illegal values will throw errors in the future
onvif@0.7.4 linerase() (lib/utils.js:35) runs parseFloat on numeric-looking strings. onvif/src/main.ts:57 and :485 copy onvifInfo.serialNumber into info unchanged, and homekit/src/info.ts:13 passes it to Characteristic.SerialNumber. Serials with hex letters stay strings:
"74619699" -> 74619699 number
"7461fb29" -> "7461fb29" string
To Reproduce
Add a Tapo C200/C110 with an all-digit serial via ONVIF and expose it to HomeKit.
Expected behavior
serialNumber stays a string, e.g. onvifInfo.serialNumber?.toString() in the ONVIF plugin or String(...) in info.ts.
Server
- OS: Debian 12 LXC
- Installation Method: Docker, server 0.147.0, onvif 0.1.31, homekit 1.2.65
Hardware Model
- Device: Tapo C200 (fw 1.9.1), Tapo C110 (fw 1.5.4)
Client
- Software: Home app
- Dominant language
- TypeScript
- Stars
- 6k
- Forks
- 399
- Avg merge
- 12h 1m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from koush/scrypted
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
[homekit] V8 heap leak via ciao MDNSServer sentPackets — bundled ciao 1.3.1 needs upgrade to ≥1.3.7 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100