-
Notifications
You must be signed in to change notification settings - Fork 299
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
feat: add auto-detection of CC2652P #1071
Conversation
src/adapter/z-stack/znp/znp.ts
Outdated
@@ -43,6 +43,7 @@ const autoDetectDefinitions = [ | |||
{manufacturer: 'Texas Instruments', vendorId: '0451', productId: '16a8'}, // CC2531 | |||
{manufacturer: 'Texas Instruments', vendorId: '0451', productId: 'bef3'}, // CC1352P_2 and CC26X2R1 | |||
{manufacturer: 'Electrolama', vendorId: '0403', productId: '6015'}, // ZZH | |||
{ manufacturer: 'Silicon Labs', vendorId: '10c4', productId: 'ea60' }, // CC2652P |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we can add this one, ea60
is from the CP210x which is also used in EmberZNet adapters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mhh, it is however added there with a different manufacturer:
{manufacturer: 'Nabu Casa', vendorId: '10c4', productId: 'ea60'},// Home Assistant SkyConnect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, the Dongle-P also has a different ID so let's merge this, can you fix the lint issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you fix the lint issues?
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Can't use manufacturer as a "reference" for auto-detect, OS drivers can overwrite it. Which is why auto detect often fails btw.
return entries.every(([key, value]) => Equals(object[key], value)); | ||
return entries.every(([key, value]) => { | ||
const objectValue = object[key]; | ||
if (typeof objectValue === 'string' && typeof value === 'string') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this change needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my system, the reported information of the chipset was in capitals so I also changed the equalsPartial method to be case-insensitive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I would propose to add an extra argument here: caseInsensitive
FYI, ZHA integration component in Home Assistant core could be used as a referece as contain index of compatible adapters: https://www.home-assistant.io/integrations/zha#discovery-via-usb-or-zeroconf See this related forum discussion about community effort to help whitelisting all compatible USB adapters: What is currently needed to automatically detect a Zigbee USB adapter is its USB Identifier (i.e. chip-ID) in combination with “Product Description String” (a.k.a. device descriptor/descriptors) in combination with its “Vendor ID” (a.k.a. vid hex) and “Product ID” (a.k.a. pid hex), however note that the USB disovery in ZHA is not specific to a single radio type but support all radio types as it then uses serial probes to detect which radio type (ezsp, znp, deconz, etc.) tha adapter running as firmware: https://github.com/home-assistant/core/blob/dev/homeassistant/components/zha/manifest.json
PS: Zeroconf is also supported in Home Assistant's ZHA integration for network discovery of some specific remote Zigbee Coordinator appliances but there is is a plan to generalize that and steer future TCP coordinators to use a general
|
Logic replaced in #1197 |
Add detection of the CC2652P (from https://item.taobao.com/item.htm?_u=j20f1ocri1b58f&id=673052067615&spm=a1z09.2.0.0.6c5f2e8dlM2Hvh or https://nl.aliexpress.com/item/1005006155691159.html?gatewayAdapt=glo2nld).
On my system, the reported information was in capitals so I also changed the
equalsPartial
method to be case-insensitive.