You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code here in device.py that gets the shelf_builder_id is supposed to just strip a trailing -6 or -st, but it seems to incorrectly force some shelf IDs to be generic.
The following JSON in devices.json leads to a generic shelf.
{"ID": "Western_Digital_Red_HDD","Type": "Storage","Hardware": "Western Digital Red HDD","Brand": "Western Digital", "Model": "WD20EFAX","Shelf": "HDD 3.5 Shelf","Rack": "6 in","ShelfId": "hdd35","HeightUnits": "2","LengthMm": "147.07 mm","Depth": "101.60 mm","Height": "26.16 mm","PoEIn": "","PoEOut": "","WattageMax": "","EstCostUsd": "$131.00","ProductWebsiteUsd": "","ProductWebsiteEur": "https://www.amazon.de/-/en/Western-Digital-Internal-Hard-Drive/dp/B083XVY99B/ref=sr_1_5","RAM": "","Field19": "","PoEInInputVoltage": "","Voltage": "","Amperage": "","WRTVersion": "","OpenWRTLink": "","Comments": "Part number is for the 2TB version"}
Whereas adding a -6 to the ShelfId fixes the issue.
{"ID": "Western_Digital_Red_HDD","Type": "Storage","Hardware": "Western Digital Red HDD","Brand": "Western Digital", "Model": "WD20EFAX","Shelf": "HDD 3.5 Shelf","Rack": "6 in","ShelfId": "hdd35-6","HeightUnits": "2","LengthMm": "147.07 mm","Depth": "101.60 mm","Height": "26.16 mm","PoEIn": "","PoEOut": "","WattageMax": "","EstCostUsd": "$131.00","ProductWebsiteUsd": "","ProductWebsiteEur": "https://www.amazon.de/-/en/Western-Digital-Internal-Hard-Drive/dp/B083XVY99B/ref=sr_1_5","RAM": "","Field19": "","PoEInInputVoltage": "","Voltage": "","Amperage": "","WRTVersion": "","OpenWRTLink": "","Comments": "Part number is for the 2TB version"}
This is legacy code. Currently the way it works is that it has to match the regex, which involves the -6 but then the -6 is stripped off.
I think having the shelf_id in the database itself is the problem. Because it splits the thinking, and means we have to update both the database and the cad to update how we build for a shelf.
The database should tell us what the hardware is. If we have made a shelf that can accept that hardware the the CAD side should know this. As we have said before we really need to have a think about what data actually belongs in the database.
The code here in device.py that gets the
shelf_builder_id
is supposed to just strip a trailing-6
or-st
, but it seems to incorrectly force some shelf IDs to begeneric
.The following JSON in devices.json leads to a generic shelf.
Whereas adding a
-6
to theShelfId
fixes the issue.@julianstirling
The text was updated successfully, but these errors were encountered: