@seamapi/react 2.20.0 → 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 (402) hide show
  1. package/README.md +4 -4
  2. package/dist/elements.js +19676 -25734
  3. package/dist/elements.js.map +1 -1
  4. package/lib/object.d.ts +5 -0
  5. package/lib/object.js +14 -0
  6. package/lib/object.js.map +1 -0
  7. package/lib/seam/SeamProvider.d.ts +5 -4
  8. package/lib/seam/SeamProvider.js.map +1 -1
  9. package/lib/seam/access-codes/use-access-code.d.ts +3 -2
  10. package/lib/seam/access-codes/use-access-code.js +2 -3
  11. package/lib/seam/access-codes/use-access-code.js.map +1 -1
  12. package/lib/seam/access-codes/use-access-codes.d.ts +3 -2
  13. package/lib/seam/access-codes/use-access-codes.js +3 -5
  14. package/lib/seam/access-codes/use-access-codes.js.map +1 -1
  15. package/lib/seam/access-codes/use-create-access-code.d.ts +4 -3
  16. package/lib/seam/access-codes/use-create-access-code.js +5 -4
  17. package/lib/seam/access-codes/use-create-access-code.js.map +1 -1
  18. package/lib/seam/access-codes/use-delete-access-code.d.ts +4 -6
  19. package/lib/seam/access-codes/use-delete-access-code.js +10 -8
  20. package/lib/seam/access-codes/use-delete-access-code.js.map +1 -1
  21. package/lib/seam/access-codes/use-generate-access-code-code.d.ts +4 -4
  22. package/lib/seam/access-codes/use-generate-access-code-code.js +3 -2
  23. package/lib/seam/access-codes/use-generate-access-code-code.js.map +1 -1
  24. package/lib/seam/access-codes/use-update-access-code.d.ts +4 -4
  25. package/lib/seam/access-codes/use-update-access-code.js +9 -7
  26. package/lib/seam/access-codes/use-update-access-code.js.map +1 -1
  27. package/lib/seam/client-sessions/use-client-session.d.ts +1 -1
  28. package/lib/seam/client-sessions/use-client-session.js +1 -1
  29. package/lib/seam/client-sessions/use-client-session.js.map +1 -1
  30. package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.d.ts +1 -1
  31. package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js +14 -6
  32. package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js.map +1 -1
  33. package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.d.ts +1 -1
  34. package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.js +9 -6
  35. package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.js.map +1 -1
  36. package/lib/seam/components/AccessCodeTable/AccessCodeHealthBar.d.ts +3 -4
  37. package/lib/seam/components/AccessCodeTable/AccessCodeHealthBar.js.map +1 -1
  38. package/lib/seam/components/AccessCodeTable/AccessCodeMainIcon.d.ts +3 -3
  39. package/lib/seam/components/AccessCodeTable/AccessCodeMainIcon.js.map +1 -1
  40. package/lib/seam/components/AccessCodeTable/AccessCodeMenu.d.ts +3 -3
  41. package/lib/seam/components/AccessCodeTable/AccessCodeMenu.js +1 -1
  42. package/lib/seam/components/AccessCodeTable/AccessCodeMenu.js.map +1 -1
  43. package/lib/seam/components/AccessCodeTable/AccessCodeRow.d.ts +3 -3
  44. package/lib/seam/components/AccessCodeTable/AccessCodeRow.js.map +1 -1
  45. package/lib/seam/components/AccessCodeTable/AccessCodeTable.d.ts +2 -4
  46. package/lib/seam/components/AccessCodeTable/AccessCodeTable.js +1 -1
  47. package/lib/seam/components/AccessCodeTable/AccessCodeTable.js.map +1 -1
  48. package/lib/seam/components/AccessCodeTable/CodeDetails.d.ts +2 -2
  49. package/lib/seam/components/AccessCodeTable/CodeDetails.js +5 -2
  50. package/lib/seam/components/AccessCodeTable/CodeDetails.js.map +1 -1
  51. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.d.ts +1 -1
  52. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.js +3 -1
  53. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.js.map +1 -1
  54. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.d.ts +1 -1
  55. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js +3 -1
  56. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js.map +1 -1
  57. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.d.ts +1 -1
  58. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.js +3 -3
  59. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.js.map +1 -1
  60. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRow.d.ts +3 -3
  61. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRow.js.map +1 -1
  62. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.d.ts +2 -2
  63. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.js.map +1 -1
  64. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.d.ts +2 -2
  65. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.js +1 -1
  66. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.js.map +1 -1
  67. package/lib/seam/components/ConnectAccountButton/ConnectAccountButton.d.ts +1 -1
  68. package/lib/seam/components/ConnectAccountButton/ConnectAccountButton.js +2 -2
  69. package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.d.ts +3 -3
  70. package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.js +12 -9
  71. package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.js.map +1 -1
  72. package/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.d.ts +1 -1
  73. package/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.js +1 -1
  74. package/lib/seam/components/DeviceDetails/DeviceDetails.d.ts +1 -1
  75. package/lib/seam/components/DeviceDetails/DeviceDetails.js +3 -1
  76. package/lib/seam/components/DeviceDetails/DeviceDetails.js.map +1 -1
  77. package/lib/seam/components/DeviceDetails/DeviceInfo.d.ts +3 -3
  78. package/lib/seam/components/DeviceDetails/DeviceInfo.js +3 -1
  79. package/lib/seam/components/DeviceDetails/DeviceInfo.js.map +1 -1
  80. package/lib/seam/components/DeviceDetails/DeviceModel.d.ts +3 -3
  81. package/lib/seam/components/DeviceDetails/LockDeviceDetails.d.ts +2 -2
  82. package/lib/seam/components/DeviceDetails/LockDeviceDetails.js +5 -5
  83. package/lib/seam/components/DeviceDetails/LockDeviceDetails.js.map +1 -1
  84. package/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.d.ts +2 -2
  85. package/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.js.map +1 -1
  86. package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.d.ts +2 -2
  87. package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js +3 -3
  88. package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js.map +1 -1
  89. package/lib/seam/components/DeviceTable/DeviceHealthBar.d.ts +3 -4
  90. package/lib/seam/components/DeviceTable/DeviceHealthBar.js.map +1 -1
  91. package/lib/seam/components/DeviceTable/DeviceRow.d.ts +4 -3
  92. package/lib/seam/components/DeviceTable/DeviceRow.js +2 -2
  93. package/lib/seam/components/DeviceTable/DeviceRow.js.map +1 -1
  94. package/lib/seam/components/DeviceTable/DeviceTable.d.ts +3 -6
  95. package/lib/seam/components/DeviceTable/DeviceTable.js +4 -2
  96. package/lib/seam/components/DeviceTable/DeviceTable.js.map +1 -1
  97. package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.d.ts +1 -1
  98. package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.js +2 -2
  99. package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.js.map +1 -1
  100. package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.d.ts +1 -1
  101. package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.d.ts +1 -1
  102. package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.d.ts +1 -1
  103. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +1 -1
  104. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +2 -2
  105. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -1
  106. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.d.ts +3 -3
  107. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js.map +1 -1
  108. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.d.ts +1 -1
  109. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.d.ts +1 -1
  110. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +1 -1
  111. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.d.ts +1 -1
  112. package/lib/seam/components/SupportedDeviceTable/use-device-model.d.ts +2 -2
  113. package/lib/seam/components/SupportedDeviceTable/use-device-model.js +3 -4
  114. package/lib/seam/components/SupportedDeviceTable/use-device-model.js.map +1 -1
  115. package/lib/seam/components/SupportedDeviceTable/use-device-models.js +2 -4
  116. package/lib/seam/components/SupportedDeviceTable/use-device-models.js.map +1 -1
  117. package/lib/seam/components/SupportedDeviceTable/use-manufacturer.d.ts +2 -2
  118. package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js +2 -3
  119. package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js.map +1 -1
  120. package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js +1 -3
  121. package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js.map +1 -1
  122. package/lib/seam/components/common-props.d.ts +2 -2
  123. package/lib/seam/components/common-props.js.map +1 -1
  124. package/lib/seam/connect-webviews/use-create-connect-webview.d.ts +4 -3
  125. package/lib/seam/connect-webviews/use-create-connect-webview.js +3 -3
  126. package/lib/seam/connect-webviews/use-create-connect-webview.js.map +1 -1
  127. package/lib/seam/connected-accounts/use-connected-account.d.ts +3 -2
  128. package/lib/seam/connected-accounts/use-connected-account.js +2 -3
  129. package/lib/seam/connected-accounts/use-connected-account.js.map +1 -1
  130. package/lib/seam/devices/use-device-providers.d.ts +3 -2
  131. package/lib/seam/devices/use-device-providers.js.map +1 -1
  132. package/lib/seam/devices/use-device.d.ts +5 -4
  133. package/lib/seam/devices/use-device.js +2 -3
  134. package/lib/seam/devices/use-device.js.map +1 -1
  135. package/lib/seam/devices/use-devices.d.ts +4 -3
  136. package/lib/seam/devices/use-devices.js +2 -3
  137. package/lib/seam/devices/use-devices.js.map +1 -1
  138. package/lib/seam/events/use-events.d.ts +5 -4
  139. package/lib/seam/events/use-events.js +5 -5
  140. package/lib/seam/events/use-events.js.map +1 -1
  141. package/lib/seam/filters.d.ts +7 -7
  142. package/lib/seam/filters.js.map +1 -1
  143. package/lib/seam/locks/lock-device.d.ts +5 -0
  144. package/lib/seam/locks/lock-device.js +2 -0
  145. package/lib/seam/locks/lock-device.js.map +1 -0
  146. package/lib/seam/locks/use-toggle-lock.d.ts +16 -0
  147. package/lib/seam/locks/use-toggle-lock.js +59 -0
  148. package/lib/seam/locks/use-toggle-lock.js.map +1 -0
  149. package/lib/seam/noise-sensors/noise-sensor-device.d.ts +5 -0
  150. package/lib/seam/noise-sensors/noise-sensor-device.js +2 -0
  151. package/lib/seam/noise-sensors/noise-sensor-device.js.map +1 -0
  152. package/lib/seam/noise-sensors/use-noise-thresholds.d.ts +4 -3
  153. package/lib/seam/noise-sensors/use-noise-thresholds.js +2 -3
  154. package/lib/seam/noise-sensors/use-noise-thresholds.js.map +1 -1
  155. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.d.ts +3 -2
  156. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.js +2 -10
  157. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.js.map +1 -1
  158. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.d.ts +3 -2
  159. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js +3 -4
  160. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js.map +1 -1
  161. package/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.d.ts +5 -3
  162. package/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.js +10 -6
  163. package/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.js.map +1 -1
  164. package/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.d.ts +5 -4
  165. package/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.js +13 -13
  166. package/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.js.map +1 -1
  167. package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.d.ts +5 -5
  168. package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.js +12 -17
  169. package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.js.map +1 -1
  170. package/lib/{temperature-bounds.d.ts → seam/thermostats/temperature-bounds.d.ts} +1 -1
  171. package/lib/{temperature-bounds.js → seam/thermostats/temperature-bounds.js} +4 -4
  172. package/lib/seam/thermostats/temperature-bounds.js.map +1 -0
  173. package/lib/seam/thermostats/thermostat-device.d.ts +17 -0
  174. package/lib/seam/thermostats/thermostat-device.js +2 -0
  175. package/lib/seam/thermostats/thermostat-device.js.map +1 -0
  176. package/lib/seam/thermostats/unit-conversion.d.ts +19 -0
  177. package/lib/seam/thermostats/unit-conversion.js +43 -0
  178. package/lib/seam/thermostats/unit-conversion.js.map +1 -0
  179. package/lib/seam/thermostats/use-cool-thermostat.d.ts +10 -4
  180. package/lib/seam/thermostats/use-cool-thermostat.js +34 -27
  181. package/lib/seam/thermostats/use-cool-thermostat.js.map +1 -1
  182. package/lib/seam/thermostats/use-heat-cool-thermostat.d.ts +10 -4
  183. package/lib/seam/thermostats/use-heat-cool-thermostat.js +34 -22
  184. package/lib/seam/thermostats/use-heat-cool-thermostat.js.map +1 -1
  185. package/lib/seam/thermostats/use-heat-thermostat.d.ts +10 -4
  186. package/lib/seam/thermostats/use-heat-thermostat.js +34 -27
  187. package/lib/seam/thermostats/use-heat-thermostat.js.map +1 -1
  188. package/lib/seam/thermostats/use-set-thermostat-fan-mode.d.ts +12 -0
  189. package/lib/seam/thermostats/use-set-thermostat-fan-mode.js +46 -0
  190. package/lib/seam/thermostats/use-set-thermostat-fan-mode.js.map +1 -0
  191. package/lib/seam/thermostats/use-set-thermostat-off.d.ts +10 -4
  192. package/lib/seam/thermostats/use-set-thermostat-off.js +36 -25
  193. package/lib/seam/thermostats/use-set-thermostat-off.js.map +1 -1
  194. package/lib/seam/thermostats/use-update-thermostat.d.ts +5 -5
  195. package/lib/seam/thermostats/use-update-thermostat.js +28 -27
  196. package/lib/seam/thermostats/use-update-thermostat.js.map +1 -1
  197. package/lib/seam/use-seam-client.d.ts +3 -3
  198. package/lib/seam/use-seam-client.js +5 -21
  199. package/lib/seam/use-seam-client.js.map +1 -1
  200. package/lib/seam/use-seam-query-result.d.ts +2 -2
  201. package/lib/ui/AccessCodeForm/AccessCodeForm.d.ts +5 -7
  202. package/lib/ui/AccessCodeForm/AccessCodeForm.js +9 -14
  203. package/lib/ui/AccessCodeForm/AccessCodeForm.js.map +1 -1
  204. package/lib/ui/AccessCodeForm/AccessCodeFormDatePicker.d.ts +1 -1
  205. package/lib/ui/AccessCodeForm/AccessCodeFormTimeZonePicker.d.ts +1 -1
  206. package/lib/ui/AccessCodeForm/AccessCodeFormTimes.d.ts +1 -1
  207. package/lib/ui/Checkbox.d.ts +1 -1
  208. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.d.ts +2 -2
  209. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js +1 -1
  210. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js.map +1 -1
  211. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.d.ts +1 -1
  212. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.js +3 -3
  213. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.js.map +1 -1
  214. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.d.ts +1 -1
  215. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.js.map +1 -1
  216. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDeviceSelect.d.ts +1 -1
  217. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormNameAndSchedule.d.ts +1 -1
  218. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormTimeZonePicker.d.ts +1 -1
  219. package/lib/ui/ClimateSettingForm/set-point-bounds.d.ts +4 -0
  220. package/lib/ui/ClimateSettingForm/set-point-bounds.js +17 -0
  221. package/lib/ui/ClimateSettingForm/set-point-bounds.js.map +1 -0
  222. package/lib/ui/DateTimePicker/DateTimePicker.d.ts +1 -1
  223. package/lib/ui/FormField.d.ts +1 -1
  224. package/lib/ui/IconButton.d.ts +1 -1
  225. package/lib/ui/LoadingToast/LoadingToast.d.ts +1 -1
  226. package/lib/ui/RadioField/Radio.d.ts +1 -1
  227. package/lib/ui/RadioField/RadioField.d.ts +1 -1
  228. package/lib/ui/Snackbar/Snackbar.d.ts +1 -1
  229. package/lib/ui/Spinner/Spinner.d.ts +1 -1
  230. package/lib/ui/Switch/Switch.d.ts +1 -1
  231. package/lib/ui/TabSet.d.ts +1 -1
  232. package/lib/ui/Table/EmptyPlaceholder.d.ts +1 -1
  233. package/lib/ui/Table/TableCell.d.ts +1 -1
  234. package/lib/ui/Table/TableFilterBar/TableFilterBar.d.ts +1 -1
  235. package/lib/ui/Table/TableFilterBar/TableFilterItem.d.ts +1 -1
  236. package/lib/ui/Table/TableRow.d.ts +1 -1
  237. package/lib/ui/TextButton.d.ts +1 -1
  238. package/lib/ui/TextField/SearchTextField.d.ts +1 -1
  239. package/lib/ui/TimeZonePicker/TimeZonePicker.d.ts +1 -1
  240. package/lib/ui/clipboard.d.ts +1 -1
  241. package/lib/ui/clipboard.js +2 -2
  242. package/lib/ui/clipboard.js.map +1 -1
  243. package/lib/ui/device/BatteryStatusIndicator.d.ts +7 -0
  244. package/lib/ui/device/{BatteryStatus.js → BatteryStatusIndicator.js} +2 -2
  245. package/lib/ui/device/BatteryStatusIndicator.js.map +1 -0
  246. package/lib/ui/device/DeviceImage.d.ts +2 -2
  247. package/lib/ui/device/LockStatus.d.ts +3 -3
  248. package/lib/ui/device/LockStatus.js +1 -1
  249. package/lib/ui/device/LockStatus.js.map +1 -1
  250. package/lib/ui/device/NoiseLevelStatus.d.ts +2 -2
  251. package/lib/ui/device/NoiseLevelStatus.js +4 -4
  252. package/lib/ui/device/NoiseLevelStatus.js.map +1 -1
  253. package/lib/ui/device/OnlineStatus.d.ts +4 -4
  254. package/lib/ui/device/OnlineStatus.js.map +1 -1
  255. package/lib/ui/layout/ContentHeader.d.ts +1 -1
  256. package/lib/ui/layout/DotDivider.d.ts +1 -1
  257. package/lib/ui/noise-sensor/NoiseSensorActivityList.d.ts +2 -2
  258. package/lib/ui/noise-sensor/NoiseSensorActivityList.js +4 -2
  259. package/lib/ui/noise-sensor/NoiseSensorActivityList.js.map +1 -1
  260. package/lib/ui/noise-sensor/NoiseSensorEventItem.d.ts +6 -3
  261. package/lib/ui/noise-sensor/NoiseSensorEventItem.js +4 -7
  262. package/lib/ui/noise-sensor/NoiseSensorEventItem.js.map +1 -1
  263. package/lib/ui/noise-sensor/NoiseThresholdsList.d.ts +2 -2
  264. package/lib/ui/noise-sensor/NoiseThresholdsList.js.map +1 -1
  265. package/lib/ui/thermostat/ClimateModeMenu.d.ts +2 -2
  266. package/lib/ui/thermostat/ClimateModeMenu.js.map +1 -1
  267. package/lib/ui/thermostat/ClimateSettingControlGroup.d.ts +2 -2
  268. package/lib/ui/thermostat/ClimateSettingControlGroup.js.map +1 -1
  269. package/lib/ui/thermostat/ClimateSettingStatus.d.ts +2 -2
  270. package/lib/ui/thermostat/ClimateSettingStatus.js +2 -2
  271. package/lib/ui/thermostat/ClimateSettingStatus.js.map +1 -1
  272. package/lib/ui/thermostat/FanModeMenu.d.ts +2 -2
  273. package/lib/ui/thermostat/FanModeMenu.js.map +1 -1
  274. package/lib/ui/thermostat/Temperature.d.ts +1 -1
  275. package/lib/ui/thermostat/TemperatureControl.d.ts +1 -1
  276. package/lib/ui/thermostat/TemperatureControlGroup.d.ts +2 -2
  277. package/lib/ui/thermostat/TemperatureControlGroup.js +1 -1
  278. package/lib/ui/thermostat/TemperatureControlGroup.js.map +1 -1
  279. package/lib/ui/thermostat/ThermoModeMenuOption.d.ts +1 -1
  280. package/lib/ui/thermostat/ThermostatCard.d.ts +2 -2
  281. package/lib/ui/thermostat/ThermostatCard.js +5 -4
  282. package/lib/ui/thermostat/ThermostatCard.js.map +1 -1
  283. package/lib/ui/thermostat/ThermostatSelect.d.ts +1 -1
  284. package/lib/ui/thermostat/ThermostatSelect.js +2 -2
  285. package/lib/ui/thermostat/ThermostatSelect.js.map +1 -1
  286. package/lib/ui/typography/Title.d.ts +1 -1
  287. package/lib/version.d.ts +1 -1
  288. package/lib/version.js +1 -1
  289. package/lib/version.js.map +1 -1
  290. package/package.json +7 -8
  291. package/src/index.scss +1 -1
  292. package/src/lib/object.ts +13 -0
  293. package/src/lib/seam/SeamProvider.tsx +9 -4
  294. package/src/lib/seam/access-codes/use-access-code.ts +10 -16
  295. package/src/lib/seam/access-codes/use-access-codes.ts +11 -18
  296. package/src/lib/seam/access-codes/use-create-access-code.ts +21 -16
  297. package/src/lib/seam/access-codes/use-delete-access-code.ts +22 -22
  298. package/src/lib/seam/access-codes/use-generate-access-code-code.ts +17 -21
  299. package/src/lib/seam/access-codes/use-update-access-code.ts +33 -25
  300. package/src/lib/seam/client-sessions/use-client-session.ts +5 -10
  301. package/src/lib/seam/components/AccessCodeDetails/AccessCodeDetails.tsx +36 -23
  302. package/src/lib/seam/components/AccessCodeDetails/AccessCodeDevice.tsx +10 -7
  303. package/src/lib/seam/components/AccessCodeTable/AccessCodeHealthBar.tsx +2 -3
  304. package/src/lib/seam/components/AccessCodeTable/AccessCodeMainIcon.tsx +3 -2
  305. package/src/lib/seam/components/AccessCodeTable/AccessCodeMenu.tsx +5 -4
  306. package/src/lib/seam/components/AccessCodeTable/AccessCodeRow.tsx +3 -2
  307. package/src/lib/seam/components/AccessCodeTable/AccessCodeTable.tsx +3 -7
  308. package/src/lib/seam/components/AccessCodeTable/CodeDetails.tsx +12 -8
  309. package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.tsx +4 -4
  310. package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.tsx +3 -3
  311. package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.tsx +6 -4
  312. package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRow.tsx +3 -2
  313. package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.tsx +1 -1
  314. package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.tsx +3 -6
  315. package/src/lib/seam/components/ConnectAccountButton/ConnectAccountButton.tsx +2 -2
  316. package/src/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.tsx +20 -16
  317. package/src/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.tsx +1 -1
  318. package/src/lib/seam/components/DeviceDetails/DeviceDetails.tsx +3 -2
  319. package/src/lib/seam/components/DeviceDetails/DeviceInfo.tsx +5 -3
  320. package/src/lib/seam/components/DeviceDetails/DeviceModel.tsx +2 -2
  321. package/src/lib/seam/components/DeviceDetails/LockDeviceDetails.tsx +6 -6
  322. package/src/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.tsx +1 -1
  323. package/src/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.tsx +7 -4
  324. package/src/lib/seam/components/DeviceTable/DeviceHealthBar.tsx +6 -3
  325. package/src/lib/seam/components/DeviceTable/DeviceRow.tsx +5 -7
  326. package/src/lib/seam/components/DeviceTable/DeviceTable.tsx +7 -14
  327. package/src/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.tsx +6 -7
  328. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +3 -4
  329. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.tsx +3 -2
  330. package/src/lib/seam/components/SupportedDeviceTable/use-device-model.ts +9 -14
  331. package/src/lib/seam/components/SupportedDeviceTable/use-device-models.ts +5 -9
  332. package/src/lib/seam/components/SupportedDeviceTable/use-manufacturer.ts +7 -12
  333. package/src/lib/seam/components/SupportedDeviceTable/use-manufacturers.ts +4 -8
  334. package/src/lib/seam/components/common-props.tsx +8 -4
  335. package/src/lib/seam/connect-webviews/use-create-connect-webview.ts +15 -17
  336. package/src/lib/seam/connected-accounts/use-connected-account.ts +17 -21
  337. package/src/lib/seam/devices/use-device-providers.ts +8 -11
  338. package/src/lib/seam/devices/use-device.ts +9 -18
  339. package/src/lib/seam/devices/use-devices.ts +20 -26
  340. package/src/lib/seam/events/use-events.ts +12 -14
  341. package/src/lib/seam/filters.ts +9 -8
  342. package/src/lib/seam/locks/lock-device.ts +9 -0
  343. package/src/lib/seam/locks/use-toggle-lock.ts +103 -0
  344. package/src/lib/seam/noise-sensors/noise-sensor-device.ts +10 -0
  345. package/src/lib/seam/noise-sensors/use-noise-thresholds.ts +12 -15
  346. package/src/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.ts +10 -23
  347. package/src/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.ts +13 -13
  348. package/src/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.ts +30 -25
  349. package/src/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.ts +26 -28
  350. package/src/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.ts +32 -41
  351. package/src/lib/{temperature-bounds.ts → seam/thermostats/temperature-bounds.ts} +8 -5
  352. package/src/lib/seam/thermostats/thermostat-device.ts +43 -0
  353. package/src/lib/seam/thermostats/unit-conversion.ts +89 -0
  354. package/src/lib/seam/thermostats/use-cool-thermostat.ts +77 -47
  355. package/src/lib/seam/thermostats/use-heat-cool-thermostat.ts +89 -40
  356. package/src/lib/seam/thermostats/use-heat-thermostat.ts +77 -47
  357. package/src/lib/seam/thermostats/use-set-thermostat-fan-mode.ts +95 -0
  358. package/src/lib/seam/thermostats/use-set-thermostat-off.ts +64 -40
  359. package/src/lib/seam/thermostats/use-update-thermostat.ts +47 -49
  360. package/src/lib/seam/use-seam-client.ts +11 -22
  361. package/src/lib/seam/use-seam-query-result.ts +2 -2
  362. package/src/lib/ui/AccessCodeForm/AccessCodeForm.tsx +18 -24
  363. package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.tsx +4 -4
  364. package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.tsx +6 -3
  365. package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.tsx +1 -1
  366. package/src/lib/ui/ClimateSettingForm/set-point-bounds.ts +31 -0
  367. package/src/lib/ui/clipboard.ts +1 -1
  368. package/src/lib/ui/device/{BatteryStatus.tsx → BatteryStatusIndicator.tsx} +10 -5
  369. package/src/lib/ui/device/DeviceImage.tsx +2 -2
  370. package/src/lib/ui/device/LockStatus.tsx +3 -2
  371. package/src/lib/ui/device/NoiseLevelStatus.tsx +3 -3
  372. package/src/lib/ui/device/OnlineStatus.tsx +3 -3
  373. package/src/lib/ui/noise-sensor/NoiseSensorActivityList.tsx +15 -6
  374. package/src/lib/ui/noise-sensor/NoiseSensorEventItem.tsx +13 -9
  375. package/src/lib/ui/noise-sensor/NoiseThresholdsList.tsx +4 -3
  376. package/src/lib/ui/thermostat/ClimateModeMenu.tsx +1 -2
  377. package/src/lib/ui/thermostat/ClimateSettingControlGroup.tsx +1 -2
  378. package/src/lib/ui/thermostat/ClimateSettingStatus.tsx +2 -3
  379. package/src/lib/ui/thermostat/FanModeMenu.tsx +1 -2
  380. package/src/lib/ui/thermostat/TemperatureControlGroup.tsx +2 -2
  381. package/src/lib/ui/thermostat/ThermostatCard.tsx +11 -8
  382. package/src/lib/ui/thermostat/ThermostatSelect.tsx +4 -10
  383. package/src/lib/version.ts +1 -1
  384. package/lib/seam/devices/use-toggle-lock.d.ts +0 -5
  385. package/lib/seam/devices/use-toggle-lock.js +0 -56
  386. package/lib/seam/devices/use-toggle-lock.js.map +0 -1
  387. package/lib/seam/error-handlers.d.ts +0 -5
  388. package/lib/seam/error-handlers.js +0 -12
  389. package/lib/seam/error-handlers.js.map +0 -1
  390. package/lib/seam/thermostats/use-update-fan-mode.d.ts +0 -6
  391. package/lib/seam/thermostats/use-update-fan-mode.js +0 -42
  392. package/lib/seam/thermostats/use-update-fan-mode.js.map +0 -1
  393. package/lib/set-point-bounds.d.ts +0 -4
  394. package/lib/set-point-bounds.js +0 -24
  395. package/lib/set-point-bounds.js.map +0 -1
  396. package/lib/temperature-bounds.js.map +0 -1
  397. package/lib/ui/device/BatteryStatus.d.ts +0 -7
  398. package/lib/ui/device/BatteryStatus.js.map +0 -1
  399. package/src/lib/seam/devices/use-toggle-lock.ts +0 -84
  400. package/src/lib/seam/error-handlers.ts +0 -19
  401. package/src/lib/seam/thermostats/use-update-fan-mode.ts +0 -81
  402. package/src/lib/set-point-bounds.ts +0 -39
@@ -1,64 +1,64 @@
1
+ import type {
2
+ SeamHttpApiError,
3
+ ThermostatsUpdateBody,
4
+ } from '@seamapi/http/connect'
5
+ import type { Device } from '@seamapi/types/connect'
1
6
  import {
2
7
  useMutation,
3
8
  type UseMutationResult,
4
9
  useQueryClient,
5
10
  } from '@tanstack/react-query'
6
- import type {
7
- SeamError,
8
- ThermostatDevice,
9
- ThermostatsListResponse,
10
- ThermostatUpdateRequest,
11
- } from 'seamapi'
12
11
 
12
+ import { shake } from 'lib/object.js'
13
13
  import { NullSeamClientError, useSeamClient } from 'lib/seam/use-seam-client.js'
14
14
 
15
- // UPSTREAM: Missing ThermostatUpdateResponse in seamapi.
16
- type UseUpdateThermostatData = Record<string, unknown>
17
- type UseUpdateThermostatMutationParams = ThermostatUpdateRequest
15
+ export type UseUpdateThermostatParams = never
16
+
17
+ export type UseUpdateThermostatData = undefined
18
+
19
+ export type UseUpdateThermostatMutationVariables = ThermostatsUpdateBody
18
20
 
19
21
  export function useUpdateThermostat(): UseMutationResult<
20
22
  UseUpdateThermostatData,
21
- SeamError,
22
- UseUpdateThermostatMutationParams
23
+ SeamHttpApiError,
24
+ UseUpdateThermostatMutationVariables
23
25
  > {
24
26
  const { client } = useSeamClient()
25
27
  const queryClient = useQueryClient()
26
28
 
27
29
  return useMutation<
28
30
  UseUpdateThermostatData,
29
- SeamError,
30
- UseUpdateThermostatMutationParams
31
+ SeamHttpApiError,
32
+ UseUpdateThermostatMutationVariables
31
33
  >({
32
- mutationFn: async (mutationParams: UseUpdateThermostatMutationParams) => {
34
+ mutationFn: async (variables) => {
33
35
  if (client === null) throw new NullSeamClientError()
34
-
35
- return await client.thermostats.update(mutationParams)
36
+ await client.thermostats.update(variables)
36
37
  },
37
38
  onSuccess: (_data, variables) => {
38
- queryClient.setQueryData<ThermostatDevice | null>(
39
+ queryClient.setQueryData<Device | null>(
39
40
  ['devices', 'get', { device_id: variables.device_id }],
40
- (thermostat) => {
41
- if (thermostat == null) {
41
+ (device) => {
42
+ if (device == null) {
42
43
  return
43
44
  }
44
-
45
- return getUpdatedThermostat(thermostat, variables)
45
+ return getUpdatedDevice(device, variables)
46
46
  }
47
47
  )
48
48
 
49
- queryClient.setQueryData<ThermostatsListResponse['thermostats']>(
49
+ queryClient.setQueryData<Device[]>(
50
50
  ['devices', 'list', { device_id: variables.device_id }],
51
- (thermostats): ThermostatDevice[] => {
52
- if (thermostats == null) {
51
+ (devices): Device[] => {
52
+ if (devices == null) {
53
53
  return []
54
54
  }
55
55
 
56
- return thermostats.map((thermostat) => {
57
- if (thermostat.device_id === variables.device_id) {
58
- return getUpdatedThermostat(thermostat, variables)
56
+ return devices.map((device) => {
57
+ if (device.device_id === variables.device_id) {
58
+ return getUpdatedDevice(device, variables)
59
59
  }
60
60
 
61
- return thermostat
61
+ return device
62
62
  })
63
63
  }
64
64
  )
@@ -66,27 +66,25 @@ export function useUpdateThermostat(): UseMutationResult<
66
66
  })
67
67
  }
68
68
 
69
- function getUpdatedThermostat(
70
- thermostat: ThermostatDevice,
71
- variables: UseUpdateThermostatMutationParams
72
- ): ThermostatDevice {
73
- return {
74
- ...thermostat,
75
-
76
- properties: {
77
- ...thermostat.properties,
78
-
79
- default_climate_setting: {
80
- ...thermostat.properties.default_climate_setting,
81
- manual_override_allowed:
82
- thermostat.properties?.default_climate_setting
83
- ?.manual_override_allowed != null
84
- ? thermostat.properties.default_climate_setting
85
- .manual_override_allowed
86
- : true,
87
-
88
- ...variables.default_climate_setting,
69
+ const getUpdatedDevice = (
70
+ device: Device,
71
+ variables: UseUpdateThermostatMutationVariables
72
+ ): Device => {
73
+ const { properties } = device
74
+ if (
75
+ 'default_climate_setting' in properties &&
76
+ properties.default_climate_setting != null
77
+ ) {
78
+ return {
79
+ ...device,
80
+ properties: {
81
+ ...properties,
82
+ default_climate_setting: {
83
+ ...properties.default_climate_setting,
84
+ ...shake(variables.default_climate_setting),
85
+ },
89
86
  },
90
- },
87
+ }
91
88
  }
89
+ return device
92
90
  }
@@ -1,13 +1,13 @@
1
+ import { SeamHttp } from '@seamapi/http/connect'
1
2
  import { useQuery } from '@tanstack/react-query'
2
3
  import { useEffect } from 'react'
3
- import { Seam } from 'seamapi'
4
4
  import { v4 as uuidv4 } from 'uuid'
5
5
 
6
6
  import { useSeamContext } from 'lib/seam/SeamProvider.js'
7
7
 
8
8
  export function useSeamClient(): {
9
- client: Seam | null
10
- isLoading: boolean
9
+ client: SeamHttp | null
10
+ isPending: boolean
11
11
  isError: boolean
12
12
  error: unknown
13
13
  } {
@@ -22,7 +22,7 @@ export function useSeamClient(): {
22
22
  clientSessionToken != null ? '' : context.userIdentifierKey
23
23
  )
24
24
 
25
- const { isLoading, isError, error, data } = useQuery<Seam>({
25
+ const { isPending, isError, error, data } = useQuery<SeamHttp>({
26
26
  queryKey: [
27
27
  'client',
28
28
  {
@@ -37,11 +37,10 @@ export function useSeamClient(): {
37
37
  if (client != null) return client
38
38
 
39
39
  if (clientSessionToken != null) {
40
- return new Seam({
41
- ...clientOptions,
42
- apiKey: null,
40
+ return SeamHttp.fromClientSessionToken(
43
41
  clientSessionToken,
44
- })
42
+ clientOptions
43
+ )
45
44
  }
46
45
 
47
46
  if (publishableKey == null) {
@@ -50,25 +49,15 @@ export function useSeamClient(): {
50
49
  )
51
50
  }
52
51
 
53
- const res = await Seam.getClientSessionToken({
54
- ...clientOptions,
52
+ return await SeamHttp.fromPublishableKey(
55
53
  publishableKey,
56
54
  userIdentifierKey,
57
- })
58
-
59
- if (!res.ok || res.client_session?.token == null) {
60
- throw new Error('Failed to get client session token')
61
- }
62
-
63
- return new Seam({
64
- ...clientOptions,
65
- apiKey: null,
66
- clientSessionToken: res.client_session.token,
67
- })
55
+ clientOptions
56
+ )
68
57
  },
69
58
  })
70
59
 
71
- return { client: data ?? null, isLoading, isError, error }
60
+ return { client: data ?? null, isPending, isError, error }
72
61
  }
73
62
 
74
63
  export class NullSeamClientError extends Error {
@@ -1,7 +1,7 @@
1
+ import type { SeamHttpApiError } from '@seamapi/http/connect'
1
2
  import type { UseQueryResult } from '@tanstack/react-query'
2
- import type { SeamError } from 'seamapi'
3
3
 
4
4
  export type UseSeamQueryResult<Field extends string, ResponsePayload> = Omit<
5
- UseQueryResult<ResponsePayload, SeamError>,
5
+ UseQueryResult<ResponsePayload, SeamHttpApiError>,
6
6
  'data'
7
7
  > & { [key in Field]?: ResponsePayload }
@@ -1,13 +1,11 @@
1
+ import type { AccessCode, Device } from '@seamapi/types/connect'
1
2
  import classNames from 'classnames'
2
3
  import { DateTime } from 'luxon'
3
4
  import { useState } from 'react'
4
5
  import { useForm } from 'react-hook-form'
5
- import { type AccessCode, type CommonDevice, isLockDevice } from 'seamapi'
6
6
 
7
7
  import { getSystemTimeZone } from 'lib/dates.js'
8
- import type { UseAccessCodeData } from 'lib/seam/access-codes/use-access-code.js'
9
8
  import { useGenerateAccessCodeCode } from 'lib/seam/access-codes/use-generate-access-code-code.js'
10
- import type { UseDeviceData } from 'lib/seam/devices/use-device.js'
11
9
  import { AccessCodeFormDatePicker } from 'lib/ui/AccessCodeForm/AccessCodeFormDatePicker.js'
12
10
  import { AccessCodeFormTimes } from 'lib/ui/AccessCodeForm/AccessCodeFormTimes.js'
13
11
  import { AccessCodeFormTimeZonePicker } from 'lib/ui/AccessCodeForm/AccessCodeFormTimeZonePicker.js'
@@ -23,7 +21,7 @@ export interface AccessCodeFormSubmitData {
23
21
  name: string
24
22
  code: string
25
23
  type: AccessCode['type']
26
- device: NonNullable<UseDeviceData>
24
+ device: Device
27
25
  startDate: string
28
26
  endDate: string
29
27
  timeZone: string
@@ -35,8 +33,8 @@ export interface ResponseErrors {
35
33
  }
36
34
 
37
35
  export interface AccessCodeFormProps {
38
- accessCode?: NonNullable<UseAccessCodeData>
39
- device: NonNullable<UseDeviceData>
36
+ accessCode?: AccessCode
37
+ device: Device
40
38
  isSubmitting: boolean
41
39
  onSubmit: (data: AccessCodeFormSubmitData) => void
42
40
  responseErrors: ResponseErrors | null
@@ -115,7 +113,7 @@ function Content({
115
113
  })
116
114
  const [timeZonePickerVisible, toggleTimeZonePicker] = useToggle()
117
115
 
118
- const { isLoading: isGeneratingCode, mutate: generateCode } =
116
+ const { isPending: isGeneratingCode, mutate: generateCode } =
119
117
  useGenerateAccessCodeCode()
120
118
 
121
119
  const submit = (): void => {}
@@ -158,10 +156,8 @@ function Content({
158
156
  device_id: device.device_id,
159
157
  },
160
158
  {
161
- onSuccess: ({ code: generatedCode }) => {
162
- if (generatedCode != null) {
163
- setValue('code', generatedCode)
164
- }
159
+ onSuccess: (generatedCode) => {
160
+ setValue('code', generatedCode)
165
161
  },
166
162
  }
167
163
  )
@@ -306,13 +302,9 @@ function Content({
306
302
  }
307
303
 
308
304
  const validateCodeLength = (
309
- device: CommonDevice,
305
+ device: Device,
310
306
  value: string
311
307
  ): boolean | string => {
312
- if (!isLockDevice(device)) {
313
- return true
314
- }
315
-
316
308
  if (device.properties.supported_code_lengths == null) {
317
309
  return true
318
310
  }
@@ -324,11 +316,7 @@ const validateCodeLength = (
324
316
  return t.codeLengthError(device.properties.supported_code_lengths.join(', '))
325
317
  }
326
318
 
327
- const getCodeLengthRequirement = (device: CommonDevice): string | null => {
328
- if (!isLockDevice(device)) {
329
- return null
330
- }
331
-
319
+ const getCodeLengthRequirement = (device: Device): string | null => {
332
320
  const codeLengths = device.properties.supported_code_lengths
333
321
  if (codeLengths == null) {
334
322
  return null
@@ -355,8 +343,8 @@ const isSequential = (numbers: string): boolean =>
355
343
  sequentialNumbers.includes(numbers)
356
344
 
357
345
  const getAccessCodeDate = (
358
- date: 'starts_at' | 'ends_at',
359
- accessCode?: NonNullable<UseAccessCodeData>
346
+ key: 'starts_at' | 'ends_at',
347
+ accessCode?: AccessCode
360
348
  ): DateTime | null => {
361
349
  if (accessCode == null) {
362
350
  return null
@@ -366,7 +354,13 @@ const getAccessCodeDate = (
366
354
  return null
367
355
  }
368
356
 
369
- return DateTime.fromISO(accessCode[date])
357
+ const date = accessCode[key]
358
+
359
+ if (date == null) {
360
+ return null
361
+ }
362
+
363
+ return DateTime.fromISO(date)
370
364
  }
371
365
 
372
366
  const getNow = (timeZone: string): DateTime => DateTime.now().setZone(timeZone)
@@ -1,14 +1,14 @@
1
1
  import classNames from 'classnames'
2
2
  import { useEffect, useState } from 'react'
3
3
  import { useForm } from 'react-hook-form'
4
+
5
+ import { getSystemTimeZone } from 'lib/dates.js'
6
+ import { useSeamClient } from 'lib/index.js'
4
7
  import {
5
8
  type ClimateSetting,
6
9
  type HvacModeSetting,
7
10
  isThermostatDevice,
8
- } from 'seamapi'
9
-
10
- import { getSystemTimeZone } from 'lib/dates.js'
11
- import { useSeamClient } from 'lib/index.js'
11
+ } from 'lib/seam/thermostats/thermostat-device.js'
12
12
  import { ClimateSettingScheduleFormClimateSetting } from 'lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.js'
13
13
  import { ClimateSettingScheduleFormDefaultClimateSetting } from 'lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.js'
14
14
  import { ClimateSettingScheduleFormDeviceSelect } from 'lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDeviceSelect.js'
@@ -1,10 +1,13 @@
1
1
  import { type Control, Controller } from 'react-hook-form'
2
- import { isThermostatDevice } from 'seamapi'
3
2
 
4
3
  import { useDevice } from 'lib/seam/devices/use-device.js'
5
- import { getSetPointBounds, type SetPointBounds } from 'lib/set-point-bounds.js'
4
+ import { isThermostatDevice } from 'lib/seam/thermostats/thermostat-device.js'
6
5
  import { Button } from 'lib/ui/Button.js'
7
6
  import type { ClimateSettingScheduleFormFields } from 'lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js'
7
+ import {
8
+ getSetPointBounds,
9
+ type SetPointBounds,
10
+ } from 'lib/ui/ClimateSettingForm/set-point-bounds.js'
8
11
  import { FormField } from 'lib/ui/FormField.js'
9
12
  import { InputLabel } from 'lib/ui/InputLabel.js'
10
13
  import { ContentHeader } from 'lib/ui/layout/ContentHeader.js'
@@ -34,7 +37,7 @@ export function ClimateSettingScheduleFormClimateSetting({
34
37
  if (device == null) return <></>
35
38
  if (!isThermostatDevice(device)) return <></>
36
39
 
37
- const setPointBounds = getSetPointBounds(device.properties)
40
+ const setPointBounds = getSetPointBounds(device)
38
41
 
39
42
  return (
40
43
  <>
@@ -1,7 +1,7 @@
1
1
  import { useState } from 'react'
2
- import type { HvacModeSetting } from 'seamapi'
3
2
 
4
3
  import { useDevice } from 'lib/seam/devices/use-device.js'
4
+ import type { HvacModeSetting } from 'lib/seam/thermostats/thermostat-device.js'
5
5
  import { Button } from 'lib/ui/Button.js'
6
6
  import { InputLabel } from 'lib/ui/InputLabel.js'
7
7
  import { ContentHeader } from 'lib/ui/layout/ContentHeader.js'
@@ -0,0 +1,31 @@
1
+ import type { ThermostatDevice } from 'lib/seam/thermostats/thermostat-device.js'
2
+ import type { TemperatureControlGroupProps } from 'lib/ui/thermostat/TemperatureControlGroup.js'
3
+
4
+ export type SetPointBounds = Partial<
5
+ Pick<
6
+ TemperatureControlGroupProps,
7
+ 'minCool' | 'maxCool' | 'minHeat' | 'maxHeat' | 'delta'
8
+ >
9
+ >
10
+
11
+ export const getSetPointBounds = (device: ThermostatDevice): SetPointBounds => {
12
+ const { properties } = device
13
+
14
+ const setPointBounds: SetPointBounds = {}
15
+
16
+ if (properties.is_cooling_available) {
17
+ setPointBounds.minCool = properties.min_cooling_set_point_fahrenheit
18
+ setPointBounds.maxCool = properties.max_cooling_set_point_fahrenheit
19
+ }
20
+
21
+ if (properties.is_heating_available) {
22
+ setPointBounds.minHeat = properties.min_heating_set_point_fahrenheit
23
+ setPointBounds.maxHeat = properties.max_heating_set_point_fahrenheit
24
+ }
25
+
26
+ if (properties.is_cooling_available && properties.is_heating_available) {
27
+ setPointBounds.delta = properties.min_heating_cooling_delta_fahrenheit
28
+ }
29
+
30
+ return setPointBounds
31
+ }
@@ -1,3 +1,3 @@
1
- export async function copyToClipboard(value: string): Promise<void> {
1
+ export const copyToClipboard = async (value: string): Promise<void> => {
2
2
  await globalThis.navigator?.clipboard?.writeText(value)
3
3
  }
@@ -1,15 +1,20 @@
1
- import type { BatteryStatus as SeamBatteryStatus, CommonDevice } from 'seamapi'
1
+ import type { Device } from '@seamapi/types/connect'
2
2
 
3
3
  import { BatteryLevelCriticalIcon } from 'lib/icons/BatteryLevelCritical.js'
4
4
  import { BatteryLevelFullIcon } from 'lib/icons/BatteryLevelFull.js'
5
5
  import { BatteryLevelHighIcon } from 'lib/icons/BatteryLevelHigh.js'
6
6
  import { BatteryLevelLowIcon } from 'lib/icons/BatteryLevelLow.js'
7
7
 
8
- interface BatteryStatusProps {
9
- device: CommonDevice
8
+ interface BatteryStatusIndicatorProps {
9
+ device: Device
10
10
  }
11
11
 
12
- export function BatteryStatus(props: BatteryStatusProps): JSX.Element {
12
+ // UPSTREAM: Missing BatteryStatusIndicator type in @seamapi/types/connect.
13
+ type BatteryStatus = 'low' | 'full' | 'critical' | 'good'
14
+
15
+ export function BatteryStatusIndicator(
16
+ props: BatteryStatusIndicatorProps
17
+ ): JSX.Element {
13
18
  return (
14
19
  <div className='seam-battery-status'>
15
20
  <Content
@@ -21,7 +26,7 @@ export function BatteryStatus(props: BatteryStatusProps): JSX.Element {
21
26
  }
22
27
 
23
28
  function Content(props: {
24
- status: SeamBatteryStatus | null | undefined
29
+ status: BatteryStatus | null | undefined
25
30
  level: number | null | undefined
26
31
  }): JSX.Element | null {
27
32
  const { status, level } = props
@@ -1,9 +1,9 @@
1
+ import type { Device } from '@seamapi/types/connect'
1
2
  import type { HTMLAttributes } from 'react'
2
- import type { CommonDevice } from 'seamapi'
3
3
 
4
4
  export function DeviceImage(
5
5
  props: {
6
- device: CommonDevice
6
+ device: Device
7
7
  } & HTMLAttributes<HTMLImageElement>
8
8
  ): JSX.Element {
9
9
  const { device, ...imageProps } = props
@@ -1,10 +1,11 @@
1
- import { type CommonDevice, isLockDevice } from 'seamapi'
1
+ import type { Device } from '@seamapi/types/connect'
2
2
 
3
3
  import { LockLockedIcon } from 'lib/icons/LockLocked.js'
4
4
  import { LockUnlockedIcon } from 'lib/icons/LockUnlocked.js'
5
+ import { isLockDevice } from 'lib/seam/locks/lock-device.js'
5
6
 
6
7
  interface LockStatusProps {
7
- device: CommonDevice
8
+ device: Device
8
9
  }
9
10
 
10
11
  export function LockStatus(props: LockStatusProps): JSX.Element | null {
@@ -1,8 +1,8 @@
1
1
  import classNames from 'classnames'
2
- import type { NoiseSensorDevice } from 'seamapi'
3
2
 
4
3
  import { NoiseLevelsIcon } from 'lib/icons/NoiseLevels.js'
5
4
  import { NoiseLevelsRedIcon } from 'lib/icons/NoiseLevelsRed.js'
5
+ import type { NoiseSensorDevice } from 'lib/seam/noise-sensors/noise-sensor-device.js'
6
6
 
7
7
  interface NoiseLevelStatusProps {
8
8
  device: NoiseSensorDevice
@@ -32,14 +32,14 @@ export function NoiseLevelStatus({
32
32
  )
33
33
  }
34
34
 
35
- function toNoiseString(value: number | string | undefined): string {
35
+ const toNoiseString = (value: number | string | undefined): string => {
36
36
  if (typeof value === 'string' || typeof value === 'number') {
37
37
  return `${Number(value).toFixed(0)} ${t.decibel}`
38
38
  }
39
39
  return t.unknown
40
40
  }
41
41
 
42
- function getNoiseLevel(device: NoiseSensorDevice): string {
42
+ const getNoiseLevel = (device: NoiseSensorDevice): string => {
43
43
  const isMinut = device.device_type === 'minut_sensor'
44
44
  const isNoiseAware = device.device_type === 'noiseaware_activity_zone'
45
45
 
@@ -1,11 +1,11 @@
1
- import type { CommonDevice } from 'seamapi'
1
+ import type { Device } from '@seamapi/types/connect'
2
2
 
3
3
  import { OnlineStatusAccountOfflineIcon } from 'lib/icons/OnlineStatusAccountOffline.js'
4
4
  import { OnlineStatusDeviceOfflineIcon } from 'lib/icons/OnlineStatusDeviceOffline.js'
5
5
  import { OnlineStatusOnlineIcon } from 'lib/icons/OnlineStatusOnline.js'
6
6
 
7
7
  interface OnlineStatusProps {
8
- device: CommonDevice
8
+ device: Device
9
9
  }
10
10
 
11
11
  export function OnlineStatus(props: OnlineStatusProps): JSX.Element {
@@ -50,7 +50,7 @@ function AccountOnlineContent(props: { isOnline: boolean }): JSX.Element {
50
50
  )
51
51
  }
52
52
 
53
- export const isDeviceAccountOffline = (device: CommonDevice): boolean =>
53
+ export const isDeviceAccountOffline = (device: Device): boolean =>
54
54
  device.errors.filter((error) => error.error_code === 'account_disconnected')
55
55
  .length > 0
56
56
 
@@ -1,7 +1,8 @@
1
+ import type { SeamEvent } from '@seamapi/types/connect'
1
2
  import { useState } from 'react'
2
- import type { NoiseSensorDevice } from 'seamapi'
3
3
 
4
4
  import { useEvents } from 'lib/seam/events/use-events.js'
5
+ import type { NoiseSensorDevice } from 'lib/seam/noise-sensors/noise-sensor-device.js'
5
6
  import { NoiseSensorEventItem } from 'lib/ui/noise-sensor/NoiseSensorEventItem.js'
6
7
  import { useNow } from 'lib/ui/use-now.js'
7
8
 
@@ -15,11 +16,19 @@ export function NoiseSensorActivityList({
15
16
  const now = useNow()
16
17
  const [mountedAt] = useState(now)
17
18
 
18
- const { events } = useEvents({
19
- device_id: device.device_id,
20
- event_type: 'noise_sensor.noise_threshold_triggered',
21
- since: mountedAt.minus({ months: 1 }).toString(),
22
- })
19
+ const result = useEvents(
20
+ {
21
+ device_id: device.device_id,
22
+ event_type: 'noise_sensor.noise_threshold_triggered',
23
+ since: mountedAt.minus({ months: 1 }).toString(),
24
+ },
25
+ { refetchInterval: 30_000 }
26
+ )
27
+
28
+ // UPSTREAM: seam.events.list should return better types.
29
+ const events = result.events as Array<
30
+ Extract<SeamEvent, { event_type: 'noise_sensor.noise_threshold_triggered' }>
31
+ >
23
32
 
24
33
  return (
25
34
  <div className='seam-noise-sensor-activity-list'>
@@ -1,10 +1,15 @@
1
+ import type { SeamEvent } from '@seamapi/types/connect'
1
2
  import { DateTime } from 'luxon'
2
- import type { Event } from 'seamapi'
3
3
 
4
4
  import { ClockIcon } from 'lib/icons/Clock.js'
5
5
 
6
+ type NoiseSensorNoiseThresholdTriggeredEvent = Extract<
7
+ SeamEvent,
8
+ { event_type: 'noise_sensor.noise_threshold_triggered' }
9
+ >
10
+
6
11
  interface NoiseSensorEventItemProps {
7
- event: Event
12
+ event: NoiseSensorNoiseThresholdTriggeredEvent
8
13
  }
9
14
 
10
15
  export function NoiseSensorEventItem({
@@ -40,16 +45,15 @@ export function NoiseSensorEventItem({
40
45
  )
41
46
  }
42
47
 
43
- function getContextSublabel(event: Event): string | null {
44
- if ('noise_threshold_name' in event) {
45
- // @ts-expect-error UPSTREAM: Shallow event type
46
- // https://github.com/seamapi/react/issues/611
48
+ const getContextSublabel = (
49
+ event: NoiseSensorNoiseThresholdTriggeredEvent
50
+ ): string | null => {
51
+ if (event.noise_threshold_name != null) {
47
52
  return event.noise_threshold_name
48
53
  }
49
54
 
50
- if ('noise_level_decibels' in event) {
51
- // UPSTREAM: Shallow event types.
52
- return `${event.noise_level_decibels as string} ${t.decibel}`
55
+ if (event.noise_level_decibels != null) {
56
+ return `${event.noise_level_decibels} ${t.decibel}`
53
57
  }
54
58
 
55
59
  return null
@@ -1,8 +1,9 @@
1
- import type { NoiseSensorDevice, NoiseThresholds } from 'seamapi'
1
+ import type { NoiseThreshold } from '@seamapi/types/connect'
2
2
  import { ZonedTime } from 'zoned-time'
3
3
 
4
4
  import { formatTime, formatTimeZone } from 'lib/dates.js'
5
5
  import { ArrowRightIcon } from 'lib/icons/ArrowRight.js'
6
+ import type { NoiseSensorDevice } from 'lib/seam/noise-sensors/noise-sensor-device.js'
6
7
  import { useNoiseThresholds } from 'lib/seam/noise-sensors/use-noise-thresholds.js'
7
8
  import { DetailRow } from 'lib/ui/layout/DetailRow.js'
8
9
  import { DetailSection } from 'lib/ui/layout/DetailSection.js'
@@ -67,7 +68,7 @@ export function NoiseThresholdsList({
67
68
  function Content({
68
69
  noiseThresholds,
69
70
  }: {
70
- noiseThresholds: NoiseThresholds[] | undefined
71
+ noiseThresholds: NoiseThreshold[] | undefined
71
72
  }): JSX.Element | JSX.Element[] {
72
73
  if (noiseThresholds == null || noiseThresholds.length === 0) {
73
74
  return (
@@ -106,7 +107,7 @@ function Content({
106
107
 
107
108
  const getTimeZoneCaption = (
108
109
  device: NoiseSensorDevice,
109
- thresholds: NoiseThresholds[] | undefined
110
+ thresholds: NoiseThreshold[] | undefined
110
111
  ): string | null => {
111
112
  if (device.location?.timezone != null) {
112
113
  return `${t.allTimesIn} ${formatTimeZone(device.location.timezone)}`
@@ -1,10 +1,9 @@
1
- import type { HvacModeSetting } from 'seamapi'
2
-
3
1
  import { ChevronDownIcon } from 'lib/icons/ChevronDown.js'
4
2
  import { OffIcon } from 'lib/icons/Off.js'
5
3
  import { ThermostatCoolIcon } from 'lib/icons/ThermostatCool.js'
6
4
  import { ThermostatHeatIcon } from 'lib/icons/ThermostatHeat.js'
7
5
  import { ThermostatHeatCoolIcon } from 'lib/icons/ThermostatHeatCool.js'
6
+ import type { HvacModeSetting } from 'lib/seam/thermostats/thermostat-device.js'
8
7
  import { Menu } from 'lib/ui/Menu/Menu.js'
9
8
  import { ThermoModeMenuOption } from 'lib/ui/thermostat/ThermoModeMenuOption.js'
10
9
 
@@ -1,5 +1,4 @@
1
- import type { HvacModeSetting } from 'seamapi'
2
-
1
+ import type { HvacModeSetting } from 'lib/seam/thermostats/thermostat-device.js'
3
2
  import { ClimateModeMenu } from 'lib/ui/thermostat/ClimateModeMenu.js'
4
3
  import {
5
4
  TemperatureControlGroup,