@seamapi/react 2.19.1 → 3.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/README.md +4 -4
  2. package/dist/elements.js +19704 -25713
  3. package/dist/elements.js.map +1 -1
  4. package/lib/icons/NoiseLevelsRed.d.ts +2 -0
  5. package/lib/icons/NoiseLevelsRed.js +5 -0
  6. package/lib/icons/NoiseLevelsRed.js.map +1 -0
  7. package/lib/object.d.ts +5 -0
  8. package/lib/object.js +14 -0
  9. package/lib/object.js.map +1 -0
  10. package/lib/seam/SeamProvider.d.ts +5 -4
  11. package/lib/seam/SeamProvider.js.map +1 -1
  12. package/lib/seam/access-codes/use-access-code.d.ts +3 -2
  13. package/lib/seam/access-codes/use-access-code.js +2 -3
  14. package/lib/seam/access-codes/use-access-code.js.map +1 -1
  15. package/lib/seam/access-codes/use-access-codes.d.ts +3 -2
  16. package/lib/seam/access-codes/use-access-codes.js +3 -5
  17. package/lib/seam/access-codes/use-access-codes.js.map +1 -1
  18. package/lib/seam/access-codes/use-create-access-code.d.ts +4 -3
  19. package/lib/seam/access-codes/use-create-access-code.js +5 -4
  20. package/lib/seam/access-codes/use-create-access-code.js.map +1 -1
  21. package/lib/seam/access-codes/use-delete-access-code.d.ts +4 -6
  22. package/lib/seam/access-codes/use-delete-access-code.js +10 -8
  23. package/lib/seam/access-codes/use-delete-access-code.js.map +1 -1
  24. package/lib/seam/access-codes/use-generate-access-code-code.d.ts +4 -4
  25. package/lib/seam/access-codes/use-generate-access-code-code.js +3 -2
  26. package/lib/seam/access-codes/use-generate-access-code-code.js.map +1 -1
  27. package/lib/seam/access-codes/use-update-access-code.d.ts +4 -4
  28. package/lib/seam/access-codes/use-update-access-code.js +9 -7
  29. package/lib/seam/access-codes/use-update-access-code.js.map +1 -1
  30. package/lib/seam/client-sessions/use-client-session.d.ts +1 -1
  31. package/lib/seam/client-sessions/use-client-session.js +1 -1
  32. package/lib/seam/client-sessions/use-client-session.js.map +1 -1
  33. package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.d.ts +1 -1
  34. package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js +14 -6
  35. package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js.map +1 -1
  36. package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.d.ts +1 -1
  37. package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.js +9 -6
  38. package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.js.map +1 -1
  39. package/lib/seam/components/AccessCodeTable/AccessCodeHealthBar.d.ts +3 -4
  40. package/lib/seam/components/AccessCodeTable/AccessCodeHealthBar.js.map +1 -1
  41. package/lib/seam/components/AccessCodeTable/AccessCodeMainIcon.d.ts +3 -3
  42. package/lib/seam/components/AccessCodeTable/AccessCodeMainIcon.js.map +1 -1
  43. package/lib/seam/components/AccessCodeTable/AccessCodeMenu.d.ts +3 -3
  44. package/lib/seam/components/AccessCodeTable/AccessCodeMenu.js +1 -1
  45. package/lib/seam/components/AccessCodeTable/AccessCodeMenu.js.map +1 -1
  46. package/lib/seam/components/AccessCodeTable/AccessCodeRow.d.ts +3 -3
  47. package/lib/seam/components/AccessCodeTable/AccessCodeRow.js.map +1 -1
  48. package/lib/seam/components/AccessCodeTable/AccessCodeTable.d.ts +2 -4
  49. package/lib/seam/components/AccessCodeTable/AccessCodeTable.js +1 -1
  50. package/lib/seam/components/AccessCodeTable/AccessCodeTable.js.map +1 -1
  51. package/lib/seam/components/AccessCodeTable/CodeDetails.d.ts +2 -2
  52. package/lib/seam/components/AccessCodeTable/CodeDetails.js +5 -2
  53. package/lib/seam/components/AccessCodeTable/CodeDetails.js.map +1 -1
  54. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.d.ts +1 -1
  55. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.js +3 -1
  56. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.js.map +1 -1
  57. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.d.ts +1 -1
  58. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js +3 -1
  59. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js.map +1 -1
  60. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.d.ts +1 -1
  61. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.js +3 -3
  62. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.js.map +1 -1
  63. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRow.d.ts +3 -3
  64. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRow.js.map +1 -1
  65. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.d.ts +2 -2
  66. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.js.map +1 -1
  67. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.d.ts +2 -2
  68. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.js +1 -1
  69. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.js.map +1 -1
  70. package/lib/seam/components/ConnectAccountButton/ConnectAccountButton.d.ts +1 -1
  71. package/lib/seam/components/ConnectAccountButton/ConnectAccountButton.js +2 -2
  72. package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.d.ts +3 -3
  73. package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.js +12 -9
  74. package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.js.map +1 -1
  75. package/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.d.ts +1 -1
  76. package/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.js +1 -1
  77. package/lib/seam/components/DeviceDetails/DeviceDetails.d.ts +1 -1
  78. package/lib/seam/components/DeviceDetails/DeviceDetails.js +3 -1
  79. package/lib/seam/components/DeviceDetails/DeviceDetails.js.map +1 -1
  80. package/lib/seam/components/DeviceDetails/DeviceInfo.d.ts +3 -3
  81. package/lib/seam/components/DeviceDetails/DeviceInfo.js +3 -1
  82. package/lib/seam/components/DeviceDetails/DeviceInfo.js.map +1 -1
  83. package/lib/seam/components/DeviceDetails/DeviceModel.d.ts +3 -3
  84. package/lib/seam/components/DeviceDetails/LockDeviceDetails.d.ts +2 -2
  85. package/lib/seam/components/DeviceDetails/LockDeviceDetails.js +5 -5
  86. package/lib/seam/components/DeviceDetails/LockDeviceDetails.js.map +1 -1
  87. package/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.d.ts +2 -2
  88. package/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.js.map +1 -1
  89. package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.d.ts +2 -2
  90. package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js +3 -3
  91. package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js.map +1 -1
  92. package/lib/seam/components/DeviceTable/DeviceHealthBar.d.ts +3 -4
  93. package/lib/seam/components/DeviceTable/DeviceHealthBar.js.map +1 -1
  94. package/lib/seam/components/DeviceTable/DeviceRow.d.ts +4 -3
  95. package/lib/seam/components/DeviceTable/DeviceRow.js +2 -2
  96. package/lib/seam/components/DeviceTable/DeviceRow.js.map +1 -1
  97. package/lib/seam/components/DeviceTable/DeviceTable.d.ts +3 -6
  98. package/lib/seam/components/DeviceTable/DeviceTable.js +4 -2
  99. package/lib/seam/components/DeviceTable/DeviceTable.js.map +1 -1
  100. package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.d.ts +1 -1
  101. package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.js +2 -2
  102. package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.js.map +1 -1
  103. package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.d.ts +1 -1
  104. package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.d.ts +1 -1
  105. package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.d.ts +1 -1
  106. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +1 -1
  107. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +2 -2
  108. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -1
  109. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.d.ts +3 -3
  110. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js.map +1 -1
  111. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.d.ts +1 -1
  112. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.d.ts +1 -1
  113. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +1 -1
  114. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.d.ts +1 -1
  115. package/lib/seam/components/SupportedDeviceTable/use-device-model.d.ts +2 -2
  116. package/lib/seam/components/SupportedDeviceTable/use-device-model.js +3 -4
  117. package/lib/seam/components/SupportedDeviceTable/use-device-model.js.map +1 -1
  118. package/lib/seam/components/SupportedDeviceTable/use-device-models.js +2 -4
  119. package/lib/seam/components/SupportedDeviceTable/use-device-models.js.map +1 -1
  120. package/lib/seam/components/SupportedDeviceTable/use-manufacturer.d.ts +2 -2
  121. package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js +2 -3
  122. package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js.map +1 -1
  123. package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js +1 -3
  124. package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js.map +1 -1
  125. package/lib/seam/components/common-props.d.ts +2 -2
  126. package/lib/seam/components/common-props.js.map +1 -1
  127. package/lib/seam/connect-webviews/use-create-connect-webview.d.ts +4 -3
  128. package/lib/seam/connect-webviews/use-create-connect-webview.js +3 -3
  129. package/lib/seam/connect-webviews/use-create-connect-webview.js.map +1 -1
  130. package/lib/seam/connected-accounts/use-connected-account.d.ts +3 -2
  131. package/lib/seam/connected-accounts/use-connected-account.js +2 -3
  132. package/lib/seam/connected-accounts/use-connected-account.js.map +1 -1
  133. package/lib/seam/devices/use-device-providers.d.ts +3 -2
  134. package/lib/seam/devices/use-device-providers.js.map +1 -1
  135. package/lib/seam/devices/use-device.d.ts +5 -4
  136. package/lib/seam/devices/use-device.js +2 -3
  137. package/lib/seam/devices/use-device.js.map +1 -1
  138. package/lib/seam/devices/use-devices.d.ts +4 -3
  139. package/lib/seam/devices/use-devices.js +2 -3
  140. package/lib/seam/devices/use-devices.js.map +1 -1
  141. package/lib/seam/events/use-events.d.ts +5 -4
  142. package/lib/seam/events/use-events.js +5 -5
  143. package/lib/seam/events/use-events.js.map +1 -1
  144. package/lib/seam/filters.d.ts +7 -7
  145. package/lib/seam/filters.js.map +1 -1
  146. package/lib/seam/locks/lock-device.d.ts +5 -0
  147. package/lib/seam/locks/lock-device.js +2 -0
  148. package/lib/seam/locks/lock-device.js.map +1 -0
  149. package/lib/seam/locks/use-toggle-lock.d.ts +16 -0
  150. package/lib/seam/locks/use-toggle-lock.js +59 -0
  151. package/lib/seam/locks/use-toggle-lock.js.map +1 -0
  152. package/lib/seam/noise-sensors/noise-sensor-device.d.ts +5 -0
  153. package/lib/seam/noise-sensors/noise-sensor-device.js +2 -0
  154. package/lib/seam/noise-sensors/noise-sensor-device.js.map +1 -0
  155. package/lib/seam/noise-sensors/use-noise-thresholds.d.ts +4 -3
  156. package/lib/seam/noise-sensors/use-noise-thresholds.js +2 -3
  157. package/lib/seam/noise-sensors/use-noise-thresholds.js.map +1 -1
  158. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.d.ts +3 -2
  159. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.js +2 -10
  160. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.js.map +1 -1
  161. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.d.ts +3 -2
  162. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js +3 -4
  163. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js.map +1 -1
  164. package/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.d.ts +5 -3
  165. package/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.js +10 -6
  166. package/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.js.map +1 -1
  167. package/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.d.ts +5 -4
  168. package/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.js +13 -13
  169. package/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.js.map +1 -1
  170. package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.d.ts +5 -5
  171. package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.js +12 -17
  172. package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.js.map +1 -1
  173. package/lib/{temperature-bounds.d.ts → seam/thermostats/temperature-bounds.d.ts} +1 -1
  174. package/lib/{temperature-bounds.js → seam/thermostats/temperature-bounds.js} +4 -4
  175. package/lib/seam/thermostats/temperature-bounds.js.map +1 -0
  176. package/lib/seam/thermostats/thermostat-device.d.ts +17 -0
  177. package/lib/seam/thermostats/thermostat-device.js +2 -0
  178. package/lib/seam/thermostats/thermostat-device.js.map +1 -0
  179. package/lib/seam/thermostats/unit-conversion.d.ts +19 -0
  180. package/lib/seam/thermostats/unit-conversion.js +43 -0
  181. package/lib/seam/thermostats/unit-conversion.js.map +1 -0
  182. package/lib/seam/thermostats/use-cool-thermostat.d.ts +10 -4
  183. package/lib/seam/thermostats/use-cool-thermostat.js +34 -27
  184. package/lib/seam/thermostats/use-cool-thermostat.js.map +1 -1
  185. package/lib/seam/thermostats/use-heat-cool-thermostat.d.ts +10 -4
  186. package/lib/seam/thermostats/use-heat-cool-thermostat.js +34 -22
  187. package/lib/seam/thermostats/use-heat-cool-thermostat.js.map +1 -1
  188. package/lib/seam/thermostats/use-heat-thermostat.d.ts +10 -4
  189. package/lib/seam/thermostats/use-heat-thermostat.js +34 -27
  190. package/lib/seam/thermostats/use-heat-thermostat.js.map +1 -1
  191. package/lib/seam/thermostats/use-set-thermostat-fan-mode.d.ts +12 -0
  192. package/lib/seam/thermostats/use-set-thermostat-fan-mode.js +46 -0
  193. package/lib/seam/thermostats/use-set-thermostat-fan-mode.js.map +1 -0
  194. package/lib/seam/thermostats/use-set-thermostat-off.d.ts +10 -4
  195. package/lib/seam/thermostats/use-set-thermostat-off.js +36 -25
  196. package/lib/seam/thermostats/use-set-thermostat-off.js.map +1 -1
  197. package/lib/seam/thermostats/use-update-thermostat.d.ts +5 -5
  198. package/lib/seam/thermostats/use-update-thermostat.js +28 -27
  199. package/lib/seam/thermostats/use-update-thermostat.js.map +1 -1
  200. package/lib/seam/use-seam-client.d.ts +3 -3
  201. package/lib/seam/use-seam-client.js +5 -21
  202. package/lib/seam/use-seam-client.js.map +1 -1
  203. package/lib/seam/use-seam-query-result.d.ts +2 -2
  204. package/lib/ui/AccessCodeForm/AccessCodeForm.d.ts +5 -7
  205. package/lib/ui/AccessCodeForm/AccessCodeForm.js +9 -14
  206. package/lib/ui/AccessCodeForm/AccessCodeForm.js.map +1 -1
  207. package/lib/ui/AccessCodeForm/AccessCodeFormDatePicker.d.ts +1 -1
  208. package/lib/ui/AccessCodeForm/AccessCodeFormTimeZonePicker.d.ts +1 -1
  209. package/lib/ui/AccessCodeForm/AccessCodeFormTimes.d.ts +1 -1
  210. package/lib/ui/Checkbox.d.ts +1 -1
  211. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.d.ts +2 -2
  212. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js +1 -1
  213. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js.map +1 -1
  214. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.d.ts +1 -1
  215. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.js +3 -3
  216. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.js.map +1 -1
  217. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.d.ts +1 -1
  218. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.js.map +1 -1
  219. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDeviceSelect.d.ts +1 -1
  220. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormNameAndSchedule.d.ts +1 -1
  221. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormTimeZonePicker.d.ts +1 -1
  222. package/lib/ui/ClimateSettingForm/set-point-bounds.d.ts +4 -0
  223. package/lib/ui/ClimateSettingForm/set-point-bounds.js +17 -0
  224. package/lib/ui/ClimateSettingForm/set-point-bounds.js.map +1 -0
  225. package/lib/ui/DateTimePicker/DateTimePicker.d.ts +1 -1
  226. package/lib/ui/FormField.d.ts +1 -1
  227. package/lib/ui/IconButton.d.ts +1 -1
  228. package/lib/ui/LoadingToast/LoadingToast.d.ts +1 -1
  229. package/lib/ui/RadioField/Radio.d.ts +1 -1
  230. package/lib/ui/RadioField/RadioField.d.ts +1 -1
  231. package/lib/ui/Snackbar/Snackbar.d.ts +1 -1
  232. package/lib/ui/Spinner/Spinner.d.ts +1 -1
  233. package/lib/ui/Switch/Switch.d.ts +1 -1
  234. package/lib/ui/TabSet.d.ts +1 -1
  235. package/lib/ui/Table/EmptyPlaceholder.d.ts +1 -1
  236. package/lib/ui/Table/TableCell.d.ts +1 -1
  237. package/lib/ui/Table/TableFilterBar/TableFilterBar.d.ts +1 -1
  238. package/lib/ui/Table/TableFilterBar/TableFilterItem.d.ts +1 -1
  239. package/lib/ui/Table/TableRow.d.ts +1 -1
  240. package/lib/ui/TextButton.d.ts +1 -1
  241. package/lib/ui/TextField/SearchTextField.d.ts +1 -1
  242. package/lib/ui/TimeZonePicker/TimeZonePicker.d.ts +1 -1
  243. package/lib/ui/clipboard.d.ts +1 -1
  244. package/lib/ui/clipboard.js +2 -2
  245. package/lib/ui/clipboard.js.map +1 -1
  246. package/lib/ui/device/BatteryStatusIndicator.d.ts +7 -0
  247. package/lib/ui/device/{BatteryStatus.js → BatteryStatusIndicator.js} +2 -2
  248. package/lib/ui/device/BatteryStatusIndicator.js.map +1 -0
  249. package/lib/ui/device/DeviceImage.d.ts +2 -2
  250. package/lib/ui/device/LockStatus.d.ts +3 -3
  251. package/lib/ui/device/LockStatus.js +1 -1
  252. package/lib/ui/device/LockStatus.js.map +1 -1
  253. package/lib/ui/device/NoiseLevelStatus.d.ts +2 -2
  254. package/lib/ui/device/NoiseLevelStatus.js +10 -5
  255. package/lib/ui/device/NoiseLevelStatus.js.map +1 -1
  256. package/lib/ui/device/OnlineStatus.d.ts +4 -4
  257. package/lib/ui/device/OnlineStatus.js.map +1 -1
  258. package/lib/ui/layout/ContentHeader.d.ts +1 -1
  259. package/lib/ui/layout/DotDivider.d.ts +1 -1
  260. package/lib/ui/noise-sensor/NoiseSensorActivityList.d.ts +2 -2
  261. package/lib/ui/noise-sensor/NoiseSensorActivityList.js +4 -2
  262. package/lib/ui/noise-sensor/NoiseSensorActivityList.js.map +1 -1
  263. package/lib/ui/noise-sensor/NoiseSensorEventItem.d.ts +6 -3
  264. package/lib/ui/noise-sensor/NoiseSensorEventItem.js +4 -7
  265. package/lib/ui/noise-sensor/NoiseSensorEventItem.js.map +1 -1
  266. package/lib/ui/noise-sensor/NoiseThresholdsList.d.ts +2 -2
  267. package/lib/ui/noise-sensor/NoiseThresholdsList.js.map +1 -1
  268. package/lib/ui/thermostat/ClimateModeMenu.d.ts +2 -2
  269. package/lib/ui/thermostat/ClimateModeMenu.js.map +1 -1
  270. package/lib/ui/thermostat/ClimateSettingControlGroup.d.ts +2 -2
  271. package/lib/ui/thermostat/ClimateSettingControlGroup.js.map +1 -1
  272. package/lib/ui/thermostat/ClimateSettingStatus.d.ts +2 -2
  273. package/lib/ui/thermostat/ClimateSettingStatus.js +2 -2
  274. package/lib/ui/thermostat/ClimateSettingStatus.js.map +1 -1
  275. package/lib/ui/thermostat/FanModeMenu.d.ts +2 -2
  276. package/lib/ui/thermostat/FanModeMenu.js.map +1 -1
  277. package/lib/ui/thermostat/Temperature.d.ts +1 -1
  278. package/lib/ui/thermostat/TemperatureControl.d.ts +1 -1
  279. package/lib/ui/thermostat/TemperatureControlGroup.d.ts +2 -2
  280. package/lib/ui/thermostat/TemperatureControlGroup.js +1 -1
  281. package/lib/ui/thermostat/TemperatureControlGroup.js.map +1 -1
  282. package/lib/ui/thermostat/ThermoModeMenuOption.d.ts +1 -1
  283. package/lib/ui/thermostat/ThermostatCard.d.ts +2 -2
  284. package/lib/ui/thermostat/ThermostatCard.js +5 -4
  285. package/lib/ui/thermostat/ThermostatCard.js.map +1 -1
  286. package/lib/ui/thermostat/ThermostatSelect.d.ts +1 -1
  287. package/lib/ui/thermostat/ThermostatSelect.js +2 -2
  288. package/lib/ui/thermostat/ThermostatSelect.js.map +1 -1
  289. package/lib/ui/typography/Title.d.ts +1 -1
  290. package/lib/version.d.ts +1 -1
  291. package/lib/version.js +1 -1
  292. package/lib/version.js.map +1 -1
  293. package/package.json +7 -8
  294. package/src/index.scss +1 -1
  295. package/src/lib/icons/NoiseLevelsRed.tsx +33 -0
  296. package/src/lib/object.ts +13 -0
  297. package/src/lib/seam/SeamProvider.tsx +9 -4
  298. package/src/lib/seam/access-codes/use-access-code.ts +10 -16
  299. package/src/lib/seam/access-codes/use-access-codes.ts +11 -18
  300. package/src/lib/seam/access-codes/use-create-access-code.ts +21 -16
  301. package/src/lib/seam/access-codes/use-delete-access-code.ts +22 -22
  302. package/src/lib/seam/access-codes/use-generate-access-code-code.ts +17 -21
  303. package/src/lib/seam/access-codes/use-update-access-code.ts +33 -25
  304. package/src/lib/seam/client-sessions/use-client-session.ts +5 -10
  305. package/src/lib/seam/components/AccessCodeDetails/AccessCodeDetails.tsx +36 -23
  306. package/src/lib/seam/components/AccessCodeDetails/AccessCodeDevice.tsx +10 -7
  307. package/src/lib/seam/components/AccessCodeTable/AccessCodeHealthBar.tsx +2 -3
  308. package/src/lib/seam/components/AccessCodeTable/AccessCodeMainIcon.tsx +3 -2
  309. package/src/lib/seam/components/AccessCodeTable/AccessCodeMenu.tsx +5 -4
  310. package/src/lib/seam/components/AccessCodeTable/AccessCodeRow.tsx +3 -2
  311. package/src/lib/seam/components/AccessCodeTable/AccessCodeTable.tsx +3 -7
  312. package/src/lib/seam/components/AccessCodeTable/CodeDetails.tsx +12 -8
  313. package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.tsx +4 -4
  314. package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.tsx +3 -3
  315. package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.tsx +6 -4
  316. package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRow.tsx +3 -2
  317. package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.tsx +1 -1
  318. package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.tsx +3 -6
  319. package/src/lib/seam/components/ConnectAccountButton/ConnectAccountButton.tsx +2 -2
  320. package/src/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.tsx +20 -16
  321. package/src/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.tsx +1 -1
  322. package/src/lib/seam/components/DeviceDetails/DeviceDetails.tsx +3 -2
  323. package/src/lib/seam/components/DeviceDetails/DeviceInfo.tsx +5 -3
  324. package/src/lib/seam/components/DeviceDetails/DeviceModel.tsx +2 -2
  325. package/src/lib/seam/components/DeviceDetails/LockDeviceDetails.tsx +6 -6
  326. package/src/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.tsx +1 -1
  327. package/src/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.tsx +7 -4
  328. package/src/lib/seam/components/DeviceTable/DeviceHealthBar.tsx +6 -3
  329. package/src/lib/seam/components/DeviceTable/DeviceRow.tsx +5 -7
  330. package/src/lib/seam/components/DeviceTable/DeviceTable.tsx +7 -14
  331. package/src/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.tsx +6 -7
  332. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +3 -4
  333. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.tsx +3 -2
  334. package/src/lib/seam/components/SupportedDeviceTable/use-device-model.ts +9 -14
  335. package/src/lib/seam/components/SupportedDeviceTable/use-device-models.ts +5 -9
  336. package/src/lib/seam/components/SupportedDeviceTable/use-manufacturer.ts +7 -12
  337. package/src/lib/seam/components/SupportedDeviceTable/use-manufacturers.ts +4 -8
  338. package/src/lib/seam/components/common-props.tsx +8 -4
  339. package/src/lib/seam/connect-webviews/use-create-connect-webview.ts +15 -17
  340. package/src/lib/seam/connected-accounts/use-connected-account.ts +17 -21
  341. package/src/lib/seam/devices/use-device-providers.ts +8 -11
  342. package/src/lib/seam/devices/use-device.ts +9 -18
  343. package/src/lib/seam/devices/use-devices.ts +20 -26
  344. package/src/lib/seam/events/use-events.ts +12 -14
  345. package/src/lib/seam/filters.ts +9 -8
  346. package/src/lib/seam/locks/lock-device.ts +9 -0
  347. package/src/lib/seam/locks/use-toggle-lock.ts +103 -0
  348. package/src/lib/seam/noise-sensors/noise-sensor-device.ts +10 -0
  349. package/src/lib/seam/noise-sensors/use-noise-thresholds.ts +12 -15
  350. package/src/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.ts +10 -23
  351. package/src/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.ts +13 -13
  352. package/src/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.ts +30 -25
  353. package/src/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.ts +26 -28
  354. package/src/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.ts +32 -41
  355. package/src/lib/{temperature-bounds.ts → seam/thermostats/temperature-bounds.ts} +8 -5
  356. package/src/lib/seam/thermostats/thermostat-device.ts +43 -0
  357. package/src/lib/seam/thermostats/unit-conversion.ts +89 -0
  358. package/src/lib/seam/thermostats/use-cool-thermostat.ts +77 -47
  359. package/src/lib/seam/thermostats/use-heat-cool-thermostat.ts +89 -40
  360. package/src/lib/seam/thermostats/use-heat-thermostat.ts +77 -47
  361. package/src/lib/seam/thermostats/use-set-thermostat-fan-mode.ts +95 -0
  362. package/src/lib/seam/thermostats/use-set-thermostat-off.ts +64 -40
  363. package/src/lib/seam/thermostats/use-update-thermostat.ts +47 -49
  364. package/src/lib/seam/use-seam-client.ts +11 -22
  365. package/src/lib/seam/use-seam-query-result.ts +2 -2
  366. package/src/lib/ui/AccessCodeForm/AccessCodeForm.tsx +18 -24
  367. package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.tsx +4 -4
  368. package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.tsx +6 -3
  369. package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.tsx +1 -1
  370. package/src/lib/ui/ClimateSettingForm/set-point-bounds.ts +31 -0
  371. package/src/lib/ui/clipboard.ts +1 -1
  372. package/src/lib/ui/device/{BatteryStatus.tsx → BatteryStatusIndicator.tsx} +10 -5
  373. package/src/lib/ui/device/DeviceImage.tsx +2 -2
  374. package/src/lib/ui/device/LockStatus.tsx +3 -2
  375. package/src/lib/ui/device/NoiseLevelStatus.tsx +17 -5
  376. package/src/lib/ui/device/OnlineStatus.tsx +3 -3
  377. package/src/lib/ui/noise-sensor/NoiseSensorActivityList.tsx +15 -6
  378. package/src/lib/ui/noise-sensor/NoiseSensorEventItem.tsx +13 -9
  379. package/src/lib/ui/noise-sensor/NoiseThresholdsList.tsx +4 -3
  380. package/src/lib/ui/thermostat/ClimateModeMenu.tsx +1 -2
  381. package/src/lib/ui/thermostat/ClimateSettingControlGroup.tsx +1 -2
  382. package/src/lib/ui/thermostat/ClimateSettingStatus.tsx +2 -3
  383. package/src/lib/ui/thermostat/FanModeMenu.tsx +1 -2
  384. package/src/lib/ui/thermostat/TemperatureControlGroup.tsx +2 -2
  385. package/src/lib/ui/thermostat/ThermostatCard.tsx +11 -8
  386. package/src/lib/ui/thermostat/ThermostatSelect.tsx +4 -10
  387. package/src/lib/version.ts +1 -1
  388. package/lib/seam/devices/use-toggle-lock.d.ts +0 -5
  389. package/lib/seam/devices/use-toggle-lock.js +0 -56
  390. package/lib/seam/devices/use-toggle-lock.js.map +0 -1
  391. package/lib/seam/error-handlers.d.ts +0 -5
  392. package/lib/seam/error-handlers.js +0 -12
  393. package/lib/seam/error-handlers.js.map +0 -1
  394. package/lib/seam/thermostats/use-update-fan-mode.d.ts +0 -6
  395. package/lib/seam/thermostats/use-update-fan-mode.js +0 -42
  396. package/lib/seam/thermostats/use-update-fan-mode.js.map +0 -1
  397. package/lib/set-point-bounds.d.ts +0 -4
  398. package/lib/set-point-bounds.js +0 -24
  399. package/lib/set-point-bounds.js.map +0 -1
  400. package/lib/temperature-bounds.js.map +0 -1
  401. package/lib/ui/device/BatteryStatus.d.ts +0 -7
  402. package/lib/ui/device/BatteryStatus.js.map +0 -1
  403. package/src/lib/seam/devices/use-toggle-lock.ts +0 -84
  404. package/src/lib/seam/error-handlers.ts +0 -19
  405. package/src/lib/seam/thermostats/use-update-fan-mode.ts +0 -81
  406. package/src/lib/set-point-bounds.ts +0 -39
@@ -1,5 +1,5 @@
1
+ import type { ClimateSettingSchedule } from '@seamapi/types/connect'
1
2
  import { DateTime } from 'luxon'
2
- import type { ClimateSettingSchedule } from 'seamapi'
3
3
 
4
4
  import { useDevice } from 'lib/seam/devices/use-device.js'
5
5
  import { DotDivider } from 'lib/ui/layout/DotDivider.js'
@@ -1,6 +1,6 @@
1
+ import type { ClimateSettingSchedule } from '@seamapi/types/connect'
1
2
  import classNames from 'classnames'
2
3
  import { useCallback, useMemo, useState } from 'react'
3
- import type { ClimateSettingSchedule } from 'seamapi'
4
4
 
5
5
  import { compareByCreatedAtDesc } from 'lib/dates.js'
6
6
  import { NestedClimateSettingScheduleDetails } from 'lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js'
@@ -9,10 +9,7 @@ import {
9
9
  type CommonProps,
10
10
  withRequiredCommonProps,
11
11
  } from 'lib/seam/components/common-props.js'
12
- import {
13
- useClimateSettingSchedules,
14
- type UseClimateSettingSchedulesData,
15
- } from 'lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js'
12
+ import { useClimateSettingSchedules } from 'lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js'
16
13
  import { useComponentTelemetry } from 'lib/telemetry/index.js'
17
14
  import { ContentHeader } from 'lib/ui/layout/ContentHeader.js'
18
15
  import { LoadingToast } from 'lib/ui/LoadingToast/LoadingToast.js'
@@ -187,7 +184,7 @@ export function ClimateSettingScheduleTable({
187
184
  }
188
185
 
189
186
  function Content(props: {
190
- climateSettingSchedules: Array<UseClimateSettingSchedulesData[number]>
187
+ climateSettingSchedules: ClimateSettingSchedule[]
191
188
  onClimateSettingScheduleClick: (climateSettingScheduleId: string) => void
192
189
  }): JSX.Element {
193
190
  const { climateSettingSchedules, onClimateSettingScheduleClick } = props
@@ -18,7 +18,7 @@ export function ConnectAccountButton({
18
18
  }: ConnectAccountButtonProps = {}): JSX.Element {
19
19
  useComponentTelemetry('ConnectAccountButton')
20
20
 
21
- const { isLoading, mutate } = useCreateConnectWebview({
21
+ const { isPending, mutate } = useCreateConnectWebview({
22
22
  willNavigateToWebview: true,
23
23
  })
24
24
 
@@ -34,7 +34,7 @@ export function ConnectAccountButton({
34
34
  size='small'
35
35
  onClick={handleClick}
36
36
  className={className}
37
- disabled={isLoading}
37
+ disabled={isPending}
38
38
  >
39
39
  {t.connectAccount}
40
40
  </Button>
@@ -1,13 +1,17 @@
1
+ import {
2
+ isSeamHttpInvalidInputError,
3
+ type SeamHttpApiError,
4
+ } from '@seamapi/http/connect'
5
+ import type { AccessCode, Device } from '@seamapi/types/connect'
1
6
  import { useState } from 'react'
2
- import type { AccessCode, SeamError } from 'seamapi'
3
7
 
8
+ import { shake } from 'lib/object.js'
4
9
  import { useCreateAccessCode } from 'lib/seam/access-codes/use-create-access-code.js'
5
10
  import {
6
11
  type CommonProps,
7
12
  withRequiredCommonProps,
8
13
  } from 'lib/seam/components/common-props.js'
9
- import { useDevice, type UseDeviceData } from 'lib/seam/devices/use-device.js'
10
- import { getValidationError } from 'lib/seam/error-handlers.js'
14
+ import { useDevice } from 'lib/seam/devices/use-device.js'
11
15
  import { useComponentTelemetry } from 'lib/telemetry/index.js'
12
16
  import {
13
17
  AccessCodeForm,
@@ -55,7 +59,7 @@ function Content({
55
59
  onBack,
56
60
  onSuccess,
57
61
  }: Omit<CreateAccessCodeFormProps, 'deviceId'> & {
58
- device: NonNullable<UseDeviceData>
62
+ device: Device
59
63
  }): JSX.Element {
60
64
  const { submit, isSubmitting, responseErrors } = useSubmitCreateAccessCode({
61
65
  onSuccess: (accessCode: AccessCode) => {
@@ -89,7 +93,7 @@ function useSubmitCreateAccessCode(params: {
89
93
  responseErrors: ResponseErrors | null
90
94
  } {
91
95
  const { onSuccess } = params
92
- const { mutate, isLoading: isSubmitting } = useCreateAccessCode()
96
+ const { mutate, isPending: isSubmitting } = useCreateAccessCode()
93
97
  const { responseErrors, handleResponseError, resetResponseErrors } =
94
98
  useResponseErrors()
95
99
 
@@ -141,7 +145,7 @@ function useSubmitCreateAccessCode(params: {
141
145
 
142
146
  export function useResponseErrors(): {
143
147
  responseErrors: ResponseErrors | null
144
- handleResponseError: (error: SeamError) => void
148
+ handleResponseError: (error: SeamHttpApiError) => void
145
149
  resetResponseErrors: () => void
146
150
  } {
147
151
  const [responseErrors, setResponseErrors] = useState<Record<
@@ -149,17 +153,17 @@ export function useResponseErrors(): {
149
153
  string | undefined
150
154
  > | null>(null)
151
155
 
152
- const handleResponseError = (error: SeamError): void => {
153
- const code = getValidationError({ error, property: 'code' })
154
- const name = getValidationError({ error, property: 'name' })
155
-
156
- if (code != null || name != null) {
157
- setResponseErrors({
158
- code,
159
- name,
156
+ const handleResponseError = (error: SeamHttpApiError): void => {
157
+ if (isSeamHttpInvalidInputError(error)) {
158
+ const errors = shake({
159
+ code: error.getValidationErrorMessages('code')[0],
160
+ name: error.getValidationErrorMessages('name')[0],
160
161
  })
161
-
162
- return
162
+ if (Object.keys(errors).length === 0) {
163
+ setResponseErrors({
164
+ unknown: error.message,
165
+ })
166
+ }
163
167
  }
164
168
 
165
169
  setResponseErrors({
@@ -30,7 +30,7 @@ function useSubmitCreateClimateSettingSchedule(onSuccess?: () => void): {
30
30
  submit: (data: ClimateSettingScheduleFormSubmitData) => void
31
31
  isSubmitting: boolean
32
32
  } {
33
- const { mutate, isLoading: isSubmitting } = useCreateClimateSettingSchedule()
33
+ const { mutate, isPending: isSubmitting } = useCreateClimateSettingSchedule()
34
34
  const submit = (data: ClimateSettingScheduleFormSubmitData): void => {
35
35
  const { name, deviceId, startDate, endDate, climateSetting } = data
36
36
 
@@ -1,5 +1,3 @@
1
- import { isLockDevice, isNoiseSensorDevice, isThermostatDevice } from 'seamapi'
2
-
3
1
  import {
4
2
  type CommonProps,
5
3
  withRequiredCommonProps,
@@ -8,6 +6,9 @@ import { LockDeviceDetails } from 'lib/seam/components/DeviceDetails/LockDeviceD
8
6
  import { NoiseSensorDeviceDetails } from 'lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.js'
9
7
  import { ThermostatDeviceDetails } from 'lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js'
10
8
  import { useDevice } from 'lib/seam/devices/use-device.js'
9
+ import { isLockDevice } from 'lib/seam/locks/lock-device.js'
10
+ import { isNoiseSensorDevice } from 'lib/seam/noise-sensors/noise-sensor-device.js'
11
+ import { isThermostatDevice } from 'lib/seam/thermostats/thermostat-device.js'
11
12
  import { useComponentTelemetry } from 'lib/telemetry/index.js'
12
13
 
13
14
  export interface DeviceDetailsProps extends CommonProps {
@@ -1,4 +1,4 @@
1
- import type { CommonDevice } from 'seamapi'
1
+ import type { Device } from '@seamapi/types/connect'
2
2
 
3
3
  import { BeeIcon } from 'lib/icons/Bee.js'
4
4
  import type { CommonProps } from 'lib/seam/components/common-props.js'
@@ -13,7 +13,7 @@ interface DeviceInfoProps
13
13
  'disableConnectedAccountInformation' | 'disableResourceIds'
14
14
  >
15
15
  > {
16
- device: CommonDevice
16
+ device: Device
17
17
  }
18
18
 
19
19
  export function DeviceInfo({
@@ -21,7 +21,9 @@ export function DeviceInfo({
21
21
  disableConnectedAccountInformation,
22
22
  disableResourceIds,
23
23
  }: DeviceInfoProps): JSX.Element | null {
24
- const { connectedAccount } = useConnectedAccount(device.connected_account_id)
24
+ const { connectedAccount } = useConnectedAccount({
25
+ connected_account_id: device.connected_account_id,
26
+ })
25
27
  return (
26
28
  <DetailSection
27
29
  label={t.deviceInfo}
@@ -1,7 +1,7 @@
1
- import type { CommonDevice } from 'seamapi'
1
+ import type { Device } from '@seamapi/types/connect'
2
2
 
3
3
  interface DeviceModelProps {
4
- device: CommonDevice
4
+ device: Device
5
5
  }
6
6
 
7
7
  export function DeviceModel({ device }: DeviceModelProps): JSX.Element | null {
@@ -1,5 +1,4 @@
1
1
  import classNames from 'classnames'
2
- import type { LockDevice } from 'seamapi'
3
2
 
4
3
  import { ChevronRightIcon } from 'lib/icons/ChevronRight.js'
5
4
  import { useAccessCodes } from 'lib/seam/access-codes/use-access-codes.js'
@@ -7,11 +6,12 @@ import { NestedAccessCodeTable } from 'lib/seam/components/AccessCodeTable/Acces
7
6
  import type { NestedSpecificDeviceDetailsProps } from 'lib/seam/components/DeviceDetails/DeviceDetails.js'
8
7
  import { DeviceInfo } from 'lib/seam/components/DeviceDetails/DeviceInfo.js'
9
8
  import { DeviceModel } from 'lib/seam/components/DeviceDetails/DeviceModel.js'
10
- import { useToggleLock } from 'lib/seam/devices/use-toggle-lock.js'
11
9
  import { deviceErrorFilter, deviceWarningFilter } from 'lib/seam/filters.js'
10
+ import type { LockDevice } from 'lib/seam/locks/lock-device.js'
11
+ import { useToggleLock } from 'lib/seam/locks/use-toggle-lock.js'
12
12
  import { Alerts } from 'lib/ui/Alert/Alerts.js'
13
13
  import { Button } from 'lib/ui/Button.js'
14
- import { BatteryStatus } from 'lib/ui/device/BatteryStatus.js'
14
+ import { BatteryStatusIndicator } from 'lib/ui/device/BatteryStatusIndicator.js'
15
15
  import { DeviceImage } from 'lib/ui/device/DeviceImage.js'
16
16
  import { OnlineStatus } from 'lib/ui/device/OnlineStatus.js'
17
17
  import { ContentHeader } from 'lib/ui/layout/ContentHeader.js'
@@ -36,7 +36,7 @@ export function LockDeviceDetails({
36
36
  className,
37
37
  }: LockDeviceDetailsProps): JSX.Element | null {
38
38
  const [accessCodesOpen, toggleAccessCodesOpen] = useToggle()
39
- const toggleLock = useToggleLock(device)
39
+ const toggleLock = useToggleLock()
40
40
  const { accessCodes } = useAccessCodes({
41
41
  device_id: device.device_id,
42
42
  })
@@ -102,7 +102,7 @@ export function LockDeviceDetails({
102
102
  <span className='seam-label'>{t.status}:</span>{' '}
103
103
  <OnlineStatus device={device} />
104
104
  <span className='seam-label'>{t.power}:</span>{' '}
105
- <BatteryStatus device={device} />
105
+ <BatteryStatusIndicator device={device} />
106
106
  <DeviceModel device={device} />
107
107
  </div>
108
108
  </div>
@@ -133,7 +133,7 @@ export function LockDeviceDetails({
133
133
  <Button
134
134
  size='small'
135
135
  onClick={() => {
136
- toggleLock.mutate()
136
+ toggleLock.mutate(device)
137
137
  }}
138
138
  >
139
139
  {toggleLockLabel}
@@ -1,10 +1,10 @@
1
1
  import classNames from 'classnames'
2
2
  import { useState } from 'react'
3
- import type { NoiseSensorDevice } from 'seamapi'
4
3
 
5
4
  import type { NestedSpecificDeviceDetailsProps } from 'lib/seam/components/DeviceDetails/DeviceDetails.js'
6
5
  import { DeviceInfo } from 'lib/seam/components/DeviceDetails/DeviceInfo.js'
7
6
  import { DeviceModel } from 'lib/seam/components/DeviceDetails/DeviceModel.js'
7
+ import type { NoiseSensorDevice } from 'lib/seam/noise-sensors/noise-sensor-device.js'
8
8
  import { DeviceImage } from 'lib/ui/device/DeviceImage.js'
9
9
  import { NoiseLevelStatus } from 'lib/ui/device/NoiseLevelStatus.js'
10
10
  import { OnlineStatus } from 'lib/ui/device/OnlineStatus.js'
@@ -1,6 +1,5 @@
1
1
  import classNames from 'classnames'
2
2
  import { useEffect, useState } from 'react'
3
- import type { HvacModeSetting, ThermostatDevice } from 'seamapi'
4
3
 
5
4
  import { debounce } from 'lib/debounce.js'
6
5
  import { CheckBlackIcon } from 'lib/icons/CheckBlack.js'
@@ -9,13 +8,17 @@ import { NestedClimateSettingScheduleTable } from 'lib/seam/components/ClimateSe
9
8
  import type { NestedSpecificDeviceDetailsProps } from 'lib/seam/components/DeviceDetails/DeviceDetails.js'
10
9
  import { DeviceInfo } from 'lib/seam/components/DeviceDetails/DeviceInfo.js'
11
10
  import { useClimateSettingSchedules } from 'lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js'
11
+ import { getSupportedThermostatModes } from 'lib/seam/thermostats/temperature-bounds.js'
12
+ import type {
13
+ HvacModeSetting,
14
+ ThermostatDevice,
15
+ } from 'lib/seam/thermostats/thermostat-device.js'
12
16
  import { useCoolThermostat } from 'lib/seam/thermostats/use-cool-thermostat.js'
13
17
  import { useHeatCoolThermostat } from 'lib/seam/thermostats/use-heat-cool-thermostat.js'
14
18
  import { useHeatThermostat } from 'lib/seam/thermostats/use-heat-thermostat.js'
19
+ import { useSetThermostatFanMode } from 'lib/seam/thermostats/use-set-thermostat-fan-mode.js'
15
20
  import { useSetThermostatOff } from 'lib/seam/thermostats/use-set-thermostat-off.js'
16
- import { useUpdateFanMode } from 'lib/seam/thermostats/use-update-fan-mode.js'
17
21
  import { useUpdateThermostat } from 'lib/seam/thermostats/use-update-thermostat.js'
18
- import { getSupportedThermostatModes } from 'lib/temperature-bounds.js'
19
22
  import { AccordionRow } from 'lib/ui/layout/AccordionRow.js'
20
23
  import { ContentHeader } from 'lib/ui/layout/ContentHeader.js'
21
24
  import { DetailRow } from 'lib/ui/layout/DetailRow.js'
@@ -203,7 +206,7 @@ function ManualOverrideRow({
203
206
  }
204
207
 
205
208
  function FanModeRow({ device }: { device: ThermostatDevice }): JSX.Element {
206
- const { mutate, isSuccess, isError } = useUpdateFanMode()
209
+ const { mutate, isSuccess, isError } = useSetThermostatFanMode()
207
210
 
208
211
  return (
209
212
  <>
@@ -1,9 +1,12 @@
1
- import type { ConnectedAccountError, DeviceError } from 'seamapi'
1
+ import type {
2
+ ConnectedAccountError,
3
+ Device,
4
+ DeviceError,
5
+ } from '@seamapi/types/connect'
2
6
 
3
7
  import { CheckIcon } from 'lib/icons/Check.js'
4
8
  import { ExclamationCircleOutlineIcon } from 'lib/icons/ExclamationCircleOutline.js'
5
9
  import { OnlineStatusAccountOfflineIcon } from 'lib/icons/OnlineStatusAccountOffline.js'
6
- import type { UseDevicesData } from 'lib/seam/devices/use-devices.js'
7
10
  import {
8
11
  connectedAccountErrorFilter,
9
12
  deviceErrorFilter,
@@ -15,7 +18,7 @@ export type AccountFilter = 'account_issues'
15
18
  export type DeviceFilter = 'device_issues'
16
19
 
17
20
  interface DeviceHealthBarProps {
18
- devices: Array<UseDevicesData[number]>
21
+ devices: Device[]
19
22
  filter: AccountFilter | DeviceFilter | null
20
23
  onFilterSelect: (filter: AccountFilter | DeviceFilter | null) => void
21
24
  errorFilter: (error: DeviceError | ConnectedAccountError) => boolean
@@ -1,10 +1,8 @@
1
+ import type { Device } from '@seamapi/types/connect'
1
2
  import classNames from 'classnames'
2
3
 
3
- import type {
4
- UseDevicesData,
5
- UseDevicesParams,
6
- } from 'lib/seam/devices/use-devices.js'
7
- import { BatteryStatus } from 'lib/ui/device/BatteryStatus.js'
4
+ import type { UseDevicesParams } from 'lib/seam/devices/use-devices.js'
5
+ import { BatteryStatusIndicator } from 'lib/ui/device/BatteryStatusIndicator.js'
8
6
  import { DeviceImage } from 'lib/ui/device/DeviceImage.js'
9
7
  import { LockStatus } from 'lib/ui/device/LockStatus.js'
10
8
  import {
@@ -22,7 +20,7 @@ interface Props {
22
20
  }
23
21
 
24
22
  interface DeviceRowProps {
25
- device: UseDevicesData[number]
23
+ device: Device
26
24
  onClick: () => void
27
25
  }
28
26
 
@@ -62,7 +60,7 @@ export function DeviceRow({
62
60
  </span>
63
61
  <div className='seam-device-statuses'>
64
62
  <OnlineStatus device={device} />
65
- {isConnected && <BatteryStatus device={device} />}
63
+ {isConnected && <BatteryStatusIndicator device={device} />}
66
64
  {isConnected && <LockStatus device={device} />}
67
65
  </div>
68
66
  </div>
@@ -1,11 +1,6 @@
1
+ import type { Device } from '@seamapi/types/connect'
1
2
  import classNames from 'classnames'
2
3
  import { useCallback, useMemo, useState } from 'react'
3
- import {
4
- type CommonDevice,
5
- isLockDevice,
6
- isNoiseSensorDevice,
7
- isThermostatDevice,
8
- } from 'seamapi'
9
4
 
10
5
  import { compareByCreatedAtDesc } from 'lib/dates.js'
11
6
  import {
@@ -19,10 +14,10 @@ import {
19
14
  DeviceHealthBar,
20
15
  } from 'lib/seam/components/DeviceTable/DeviceHealthBar.js'
21
16
  import { DeviceRow } from 'lib/seam/components/DeviceTable/DeviceRow.js'
22
- import {
23
- useDevices,
24
- type UseDevicesData,
25
- } from 'lib/seam/devices/use-devices.js'
17
+ import { useDevices } from 'lib/seam/devices/use-devices.js'
18
+ import { isLockDevice } from 'lib/seam/locks/lock-device.js'
19
+ import { isNoiseSensorDevice } from 'lib/seam/noise-sensors/noise-sensor-device.js'
20
+ import { isThermostatDevice } from 'lib/seam/thermostats/thermostat-device.js'
26
21
  import { useComponentTelemetry } from 'lib/telemetry/index.js'
27
22
  import { ContentHeader } from 'lib/ui/layout/ContentHeader.js'
28
23
  import { LoadingToast } from 'lib/ui/LoadingToast/LoadingToast.js'
@@ -34,8 +29,6 @@ import { TableTitle } from 'lib/ui/Table/TableTitle.js'
34
29
  import { SearchTextField } from 'lib/ui/TextField/SearchTextField.js'
35
30
  import { Caption } from 'lib/ui/typography/Caption.js'
36
31
 
37
- type Device = UseDevicesData[number]
38
-
39
32
  export interface DeviceTableProps extends CommonProps {
40
33
  deviceIds?: string[]
41
34
  connectedAccountIds?: string[]
@@ -48,7 +41,7 @@ export interface DeviceTableProps extends CommonProps {
48
41
  }
49
42
 
50
43
  export const defaultDeviceFilter = (
51
- device: CommonDevice,
44
+ device: Device,
52
45
  searchInputValue: string
53
46
  ): boolean => {
54
47
  const value = searchInputValue.trim()
@@ -184,7 +177,7 @@ export function DeviceTable({
184
177
  }
185
178
 
186
179
  function Content(props: {
187
- devices: Array<UseDevicesData[number]>
180
+ devices: Device[]
188
181
  onDeviceClick: (deviceId: string) => void
189
182
  errorFilter: (error: any) => boolean
190
183
  }): JSX.Element {
@@ -1,7 +1,6 @@
1
- import {
2
- useAccessCode,
3
- type UseAccessCodeData,
4
- } from 'lib/seam/access-codes/use-access-code.js'
1
+ import type { AccessCode } from '@seamapi/types/connect'
2
+
3
+ import { useAccessCode } from 'lib/seam/access-codes/use-access-code.js'
5
4
  import { useUpdateAccessCode } from 'lib/seam/access-codes/use-update-access-code.js'
6
5
  import {
7
6
  type CommonProps,
@@ -56,7 +55,7 @@ function Content({
56
55
  accessCode,
57
56
  onSuccess,
58
57
  }: Omit<EditAccessCodeFormProps, 'accessCodeId'> & {
59
- accessCode: NonNullable<UseAccessCodeData>
58
+ accessCode: AccessCode
60
59
  }): JSX.Element | null {
61
60
  const { device } = useDevice({
62
61
  device_id: accessCode.device_id,
@@ -93,14 +92,14 @@ function Content({
93
92
  }
94
93
 
95
94
  function useSubmitEditAccessCode(
96
- accessCode: NonNullable<UseAccessCodeData>,
95
+ accessCode: AccessCode,
97
96
  onSuccess?: () => void
98
97
  ): {
99
98
  submit: (data: AccessCodeFormSubmitData) => void
100
99
  isSubmitting: boolean
101
100
  responseErrors: ResponseErrors | null
102
101
  } {
103
- const { mutate, isLoading: isSubmitting } = useUpdateAccessCode()
102
+ const { mutate, isPending: isSubmitting } = useUpdateAccessCode()
104
103
  const { responseErrors, handleResponseError, resetResponseErrors } =
105
104
  useResponseErrors()
106
105
 
@@ -2,7 +2,6 @@ import type { DeviceModel } from '@seamapi/types/devicedb'
2
2
  import { useMemo } from 'react'
3
3
 
4
4
  import { SupportedDeviceManufacturerSection } from 'lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js'
5
- import type { UseDeviceModelsData } from 'lib/seam/components/SupportedDeviceTable/use-device-models.js'
6
5
  import {
7
6
  type DeviceModelFilters,
8
7
  useFilteredDeviceModels,
@@ -28,7 +27,7 @@ export function SupportedDeviceContent({
28
27
  includeIf,
29
28
  excludeIf,
30
29
  }: SupportedDeviceContentProps): JSX.Element | null {
31
- const { deviceModels, isLoading, isError, refetch } = useFilteredDeviceModels(
30
+ const { deviceModels, isPending, isError, refetch } = useFilteredDeviceModels(
32
31
  {
33
32
  filterValue,
34
33
  filters,
@@ -44,7 +43,7 @@ export function SupportedDeviceContent({
44
43
  [deviceModels]
45
44
  )
46
45
 
47
- if (isLoading) {
46
+ if (isPending) {
48
47
  return (
49
48
  <div className='seam-supported-device-table-content-state-block'>
50
49
  <p>{t.loading}</p>
@@ -140,7 +139,7 @@ function EmptyResult({
140
139
  }
141
140
 
142
141
  const groupDeviceModelsByManufacturer = (
143
- deviceModels: UseDeviceModelsData
142
+ deviceModels: DeviceModel[]
144
143
  ): Record<string, DeviceModel[]> => {
145
144
  const result: Record<string, DeviceModel[]> = {}
146
145
 
@@ -1,8 +1,9 @@
1
+ import type { DeviceModel } from '@seamapi/types/devicedb'
2
+
1
3
  import { SupportedDeviceRow } from 'lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js'
2
- import type { UseDeviceModelsData } from 'lib/seam/components/SupportedDeviceTable/use-device-models.js'
3
4
 
4
5
  interface SupportedDeviceContentRowsProps {
5
- deviceModels: UseDeviceModelsData
6
+ deviceModels: DeviceModel[]
6
7
  }
7
8
 
8
9
  export function SupportedDeviceContentRows({
@@ -1,45 +1,40 @@
1
+ import type { SeamHttpApiError } from '@seamapi/http/connect'
1
2
  import type {
2
3
  DeviceModel,
3
4
  RouteRequestParams,
4
5
  RouteResponse,
5
6
  } from '@seamapi/types/devicedb'
6
7
  import { useQuery } from '@tanstack/react-query'
7
- import type { SeamError } from 'seamapi'
8
8
 
9
9
  import { useSeamClient } from 'lib/seam/use-seam-client.js'
10
10
  import type { UseSeamQueryResult } from 'lib/seam/use-seam-query-result.js'
11
11
 
12
- export type UseDeviceModelParams = DeviceModelsGetParams | string
12
+ export type UseDeviceModelParams = DeviceModelsGetParams
13
+
13
14
  export type UseDeviceModelData = DeviceModel | null
14
15
 
15
16
  export function useDeviceModel(
16
- params?: UseDeviceModelParams
17
+ params: UseDeviceModelParams
17
18
  ): UseSeamQueryResult<'deviceModel', UseDeviceModelData> {
18
- const normalizedParams =
19
- typeof params === 'string' ? { device_model_id: params } : params
20
-
21
19
  const { client: seam } = useSeamClient()
22
- const { data, ...rest } = useQuery<
23
- DeviceModelsGetResponse['device_model'] | null,
24
- SeamError
25
- >({
20
+ const { data, ...rest } = useQuery<UseDeviceModelData, SeamHttpApiError>({
26
21
  enabled: seam != null,
27
- queryKey: ['internal', 'device_models', 'get', normalizedParams],
22
+ queryKey: ['internal', 'device_models', 'get', params],
28
23
  queryFn: async () => {
29
24
  if (seam == null) return null
30
25
  const {
31
26
  data: { device_model: deviceModel },
32
27
  } = await seam.client.get<DeviceModelsGetResponse>(
33
28
  '/internal/devicedb/v1/device_models/get',
34
- { params: normalizedParams }
29
+ { params }
35
30
  )
36
- return deviceModel
31
+ // UPSTREAM: Response type does not match DeviceModel.
32
+ return deviceModel as DeviceModel
37
33
  },
38
34
  })
39
35
 
40
36
  return {
41
37
  ...rest,
42
- // @ts-expect-error: Upstream mismatch between type and route type.
43
38
  deviceModel: data,
44
39
  }
45
40
  }
@@ -1,15 +1,16 @@
1
+ import type { SeamHttpApiError } from '@seamapi/http/connect'
1
2
  import type {
2
3
  DeviceModel,
3
4
  RouteRequestParams,
4
5
  RouteResponse,
5
6
  } from '@seamapi/types/devicedb'
6
7
  import { useQuery, useQueryClient } from '@tanstack/react-query'
7
- import type { SeamError } from 'seamapi'
8
8
 
9
9
  import { useSeamClient } from 'lib/seam/use-seam-client.js'
10
10
  import type { UseSeamQueryResult } from 'lib/seam/use-seam-query-result.js'
11
11
 
12
12
  export type UseDeviceModelsParams = DeviceModelsListParams
13
+
13
14
  export type UseDeviceModelsData = DeviceModel[]
14
15
 
15
16
  export function useDeviceModels(
@@ -18,10 +19,7 @@ export function useDeviceModels(
18
19
  const { client: seam } = useSeamClient()
19
20
  const queryClient = useQueryClient()
20
21
 
21
- const { data, ...rest } = useQuery<
22
- DeviceModelsListResponse['device_models'],
23
- SeamError
24
- >({
22
+ const { data, ...rest } = useQuery<UseDeviceModelsData, SeamHttpApiError>({
25
23
  enabled: seam != null,
26
24
  queryKey: ['internal', 'device_models', 'list', params],
27
25
  queryFn: async () => {
@@ -32,9 +30,6 @@ export function useDeviceModels(
32
30
  '/internal/devicedb/v1/device_models/list',
33
31
  { params }
34
32
  )
35
- return deviceModels
36
- },
37
- onSuccess: (deviceModels) => {
38
33
  for (const deviceModel of deviceModels) {
39
34
  queryClient.setQueryData(
40
35
  [
@@ -46,12 +41,13 @@ export function useDeviceModels(
46
41
  deviceModel
47
42
  )
48
43
  }
44
+ // UPSTREAM: Response type does not match DeviceModel[].
45
+ return deviceModels as DeviceModel[]
49
46
  },
50
47
  })
51
48
 
52
49
  return {
53
50
  ...rest,
54
- // @ts-expect-error: Upstream mismatch between type and route type.
55
51
  deviceModels: data,
56
52
  }
57
53
  }
@@ -1,37 +1,32 @@
1
+ import type { SeamHttpApiError } from '@seamapi/http/connect'
1
2
  import type {
2
3
  Manufacturer,
3
4
  RouteRequestParams,
4
5
  RouteResponse,
5
6
  } from '@seamapi/types/devicedb'
6
7
  import { useQuery } from '@tanstack/react-query'
7
- import type { SeamError } from 'seamapi'
8
8
 
9
9
  import { useSeamClient } from 'lib/seam/use-seam-client.js'
10
10
  import type { UseSeamQueryResult } from 'lib/seam/use-seam-query-result.js'
11
11
 
12
- export type UseManufacturerParams = ManufacturersGetParams | string
12
+ export type UseManufacturerParams = ManufacturersGetParams
13
+
13
14
  export type UseManufacturerData = Manufacturer | null
14
15
 
15
16
  export function useManufacturer(
16
- params?: UseManufacturerParams
17
+ params: UseManufacturerParams
17
18
  ): UseSeamQueryResult<'manufacturer', UseManufacturerData> {
18
- const normalizedParams =
19
- typeof params === 'string' ? { manufacturer_id: params } : params
20
-
21
19
  const { client: seam } = useSeamClient()
22
- const { data, ...rest } = useQuery<
23
- ManufacturersGetResponse['manufacturer'] | null,
24
- SeamError
25
- >({
20
+ const { data, ...rest } = useQuery<UseManufacturerData, SeamHttpApiError>({
26
21
  enabled: seam != null,
27
- queryKey: ['internal', 'manufacturers', 'get', normalizedParams],
22
+ queryKey: ['internal', 'manufacturers', 'get', params],
28
23
  queryFn: async () => {
29
24
  if (seam == null) return null
30
25
  const {
31
26
  data: { manufacturer },
32
27
  } = await seam.client.get<ManufacturersGetResponse>(
33
28
  '/internal/devicedb/v1/manufacturers/get',
34
- { params: normalizedParams }
29
+ { params }
35
30
  )
36
31
  return manufacturer
37
32
  },