[Edge Driver] Is it resonable project structure?

Hello, I’m new to Edge Driver. And I want to organize my edge driver project.

Unlike Zigbee, LAN driver has duplicated codes to find, manage and communicate with devices.

But other point, These devices have very different characteristic, so I reckon sub driver is not for me.

I wonder below structure is good?

my_drivers$ tree
.
├── device_A
│   ├── profiles
│   │   └── profile_A.lua
│   └── src
│       └── init.lua
├── device_B
│   ├── profiles
│   │   └── profile_B.lua
│   └── src
│       └── init.lua
├── device_C
│   ├── profiles
│   │   └── profile_C.lua
│   └── src
│       └── init.lua
└── my_shared_code
1 Like

Are you talking about 1 single driver or 3 separated ones?

Totally different devices. So sperated ones, like Light, Gas valve, Sensors, etc…

This is the structure.

If you have shared codes for different drivers, you will need to copy those files into this structure of each driver.

You may have a single driver for light, gas valve, sensors, … but they would be separated into subdrivers.
This single driver could be for everything from a specific manufacturer, for example.

1 Like

This is correct. If you wanted to share code between devices, they would have to be in the same driver but in the case of LAN, the discovery process would change because, when we use Zigbee, it is easier to separate the joining process according to the device fingerprint.
For LAN devices, what others do is discover the main device from which the users can create other devices, but this depends on your needs. For example, this project shared by a Community member

Also, just for you to consider, have you checked the other integration types to see if they would adapt better to your case?
For example, the SmartThings Schema Connector would allow you to create and manage different devices in the same integration and all can be discovered when the user logins into his/her account. However, their execution would be in the cloud, not local as in Edge.

2 Likes