Skip to content

Commit

Permalink
Fix CO2 calibration
Browse files Browse the repository at this point in the history
  • Loading branch information
oscgonfer committed Oct 7, 2024
1 parent d279af9 commit e141460
Showing 1 changed file with 1 addition and 67 deletions.
68 changes: 1 addition & 67 deletions deliveries/TwinAir/240603_TwinAIR-Cabin-CO2-calibration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,80 +44,14 @@
" }])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d4177b2a-b490-479a-b7d8-c4f19895a3eb",
"metadata": {},
"outputs": [],
"source": [
"# Find by MAC addresses\n",
"devices = []\n",
"mac_addresses = ['CF65', 'C9F0', '7D71', 'B5E9', 'C8C7', 'D3CD']"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5c0c8d53-0b71-43fd-9cde-8f884e08ab16",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"for item in df['postprocessing']:\n",
" name = df.loc[item['device_id'], 'name']\n",
" # print (item['device_id'], df.loc[item['device_id'], 'name'], item['meta'])\n",
" if item['meta'] is None: continue\n",
" if 'twinair' not in item['meta'].lower(): continue\n",
" if '#' in name:\n",
" ind = name.index('#') + 1\n",
" if name[ind:] in mac_addresses: \n",
" print (f\"Found: {name[ind:]} - {item['device_id']}\")\n",
" devices.append(item['device_id'])\n",
" else:\n",
" d = smartcitizen_connector.SCDevice(item['device_id'])\n",
" mac = d.last_status_message.mac.replace(':','')[-4:]\n",
" if mac in mac_addresses: \n",
" print (f\"Digging deeper, found: {name[ind:]} - {item['device_id']}\")\n",
" devices.append(item['device_id'])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0808b138-3a98-4ddd-ba4e-f7365a63d627",
"metadata": {},
"outputs": [],
"source": [
"devices"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d614943f-87d1-45c0-bbd0-5ea661033dbf",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"macs = {}\n",
"for device in devices:\n",
" a = smartcitizen_connector.SCDevice(device)\n",
" macs[device] = a.last_status_message"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "07b89fb2-a9c7-47bb-bae1-6467fbf1838c",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"macs"
"devices = [17265, 17295, 17306, 17313, 17318, 17319]"
]
},
{
Expand Down

0 comments on commit e141460

Please sign in to comment.