If I understand your question you want to insert a product into the products table and then, depending on whether it is an accessory or a smart device, also insert into the relevant secondary table.
So your secondary, subclass tables will have a productId column that matches the productId in the products table.
Insert a product into the products table and return the inserted productId. Use that id to do the insert into the secondary table. You now have a link between the two.
You can also add a foreign key constraint from accessories/smart devices to products with on delete cascade to keep your table integrity intact.
is that any help?
If you're in one of those predicaments where cls.__private attributes just aren't enough since they can easily be accessed through inst._cls__private, and you need something a little more secure, here's ...