@seamapi/react 2.20.0 → 3.0.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.
- package/README.md +4 -4
- package/dist/elements.js +19676 -25734
- package/dist/elements.js.map +1 -1
- package/lib/object.d.ts +5 -0
- package/lib/object.js +14 -0
- package/lib/object.js.map +1 -0
- package/lib/seam/SeamProvider.d.ts +5 -4
- package/lib/seam/SeamProvider.js.map +1 -1
- package/lib/seam/access-codes/use-access-code.d.ts +3 -2
- package/lib/seam/access-codes/use-access-code.js +2 -3
- package/lib/seam/access-codes/use-access-code.js.map +1 -1
- package/lib/seam/access-codes/use-access-codes.d.ts +3 -2
- package/lib/seam/access-codes/use-access-codes.js +3 -5
- package/lib/seam/access-codes/use-access-codes.js.map +1 -1
- package/lib/seam/access-codes/use-create-access-code.d.ts +4 -3
- package/lib/seam/access-codes/use-create-access-code.js +5 -4
- package/lib/seam/access-codes/use-create-access-code.js.map +1 -1
- package/lib/seam/access-codes/use-delete-access-code.d.ts +4 -6
- package/lib/seam/access-codes/use-delete-access-code.js +10 -8
- package/lib/seam/access-codes/use-delete-access-code.js.map +1 -1
- package/lib/seam/access-codes/use-generate-access-code-code.d.ts +4 -4
- package/lib/seam/access-codes/use-generate-access-code-code.js +3 -2
- package/lib/seam/access-codes/use-generate-access-code-code.js.map +1 -1
- package/lib/seam/access-codes/use-update-access-code.d.ts +4 -4
- package/lib/seam/access-codes/use-update-access-code.js +9 -7
- package/lib/seam/access-codes/use-update-access-code.js.map +1 -1
- package/lib/seam/client-sessions/use-client-session.d.ts +1 -1
- package/lib/seam/client-sessions/use-client-session.js +1 -1
- package/lib/seam/client-sessions/use-client-session.js.map +1 -1
- package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.d.ts +1 -1
- package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js +14 -6
- package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js.map +1 -1
- package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.d.ts +1 -1
- package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.js +9 -6
- package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.js.map +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeHealthBar.d.ts +3 -4
- package/lib/seam/components/AccessCodeTable/AccessCodeHealthBar.js.map +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeMainIcon.d.ts +3 -3
- package/lib/seam/components/AccessCodeTable/AccessCodeMainIcon.js.map +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeMenu.d.ts +3 -3
- package/lib/seam/components/AccessCodeTable/AccessCodeMenu.js +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeMenu.js.map +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeRow.d.ts +3 -3
- package/lib/seam/components/AccessCodeTable/AccessCodeRow.js.map +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.d.ts +2 -4
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js.map +1 -1
- package/lib/seam/components/AccessCodeTable/CodeDetails.d.ts +2 -2
- package/lib/seam/components/AccessCodeTable/CodeDetails.js +5 -2
- package/lib/seam/components/AccessCodeTable/CodeDetails.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.d.ts +1 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.js +3 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.d.ts +1 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js +3 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.d.ts +1 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.js +3 -3
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRow.d.ts +3 -3
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRow.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.d.ts +2 -2
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.d.ts +2 -2
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.js +1 -1
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.js.map +1 -1
- package/lib/seam/components/ConnectAccountButton/ConnectAccountButton.d.ts +1 -1
- package/lib/seam/components/ConnectAccountButton/ConnectAccountButton.js +2 -2
- package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.d.ts +3 -3
- package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.js +12 -9
- package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.js.map +1 -1
- package/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.d.ts +1 -1
- package/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.js +1 -1
- package/lib/seam/components/DeviceDetails/DeviceDetails.d.ts +1 -1
- package/lib/seam/components/DeviceDetails/DeviceDetails.js +3 -1
- package/lib/seam/components/DeviceDetails/DeviceDetails.js.map +1 -1
- package/lib/seam/components/DeviceDetails/DeviceInfo.d.ts +3 -3
- package/lib/seam/components/DeviceDetails/DeviceInfo.js +3 -1
- package/lib/seam/components/DeviceDetails/DeviceInfo.js.map +1 -1
- package/lib/seam/components/DeviceDetails/DeviceModel.d.ts +3 -3
- package/lib/seam/components/DeviceDetails/LockDeviceDetails.d.ts +2 -2
- package/lib/seam/components/DeviceDetails/LockDeviceDetails.js +5 -5
- package/lib/seam/components/DeviceDetails/LockDeviceDetails.js.map +1 -1
- package/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.d.ts +2 -2
- package/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.js.map +1 -1
- package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.d.ts +2 -2
- package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js +3 -3
- package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js.map +1 -1
- package/lib/seam/components/DeviceTable/DeviceHealthBar.d.ts +3 -4
- package/lib/seam/components/DeviceTable/DeviceHealthBar.js.map +1 -1
- package/lib/seam/components/DeviceTable/DeviceRow.d.ts +4 -3
- package/lib/seam/components/DeviceTable/DeviceRow.js +2 -2
- package/lib/seam/components/DeviceTable/DeviceRow.js.map +1 -1
- package/lib/seam/components/DeviceTable/DeviceTable.d.ts +3 -6
- package/lib/seam/components/DeviceTable/DeviceTable.js +4 -2
- package/lib/seam/components/DeviceTable/DeviceTable.js.map +1 -1
- package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.d.ts +1 -1
- package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.js +2 -2
- package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +2 -2
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.d.ts +3 -3
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/use-device-model.d.ts +2 -2
- package/lib/seam/components/SupportedDeviceTable/use-device-model.js +3 -4
- package/lib/seam/components/SupportedDeviceTable/use-device-model.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/use-device-models.js +2 -4
- package/lib/seam/components/SupportedDeviceTable/use-device-models.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/use-manufacturer.d.ts +2 -2
- package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js +2 -3
- package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js +1 -3
- package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js.map +1 -1
- package/lib/seam/components/common-props.d.ts +2 -2
- package/lib/seam/components/common-props.js.map +1 -1
- package/lib/seam/connect-webviews/use-create-connect-webview.d.ts +4 -3
- package/lib/seam/connect-webviews/use-create-connect-webview.js +3 -3
- package/lib/seam/connect-webviews/use-create-connect-webview.js.map +1 -1
- package/lib/seam/connected-accounts/use-connected-account.d.ts +3 -2
- package/lib/seam/connected-accounts/use-connected-account.js +2 -3
- package/lib/seam/connected-accounts/use-connected-account.js.map +1 -1
- package/lib/seam/devices/use-device-providers.d.ts +3 -2
- package/lib/seam/devices/use-device-providers.js.map +1 -1
- package/lib/seam/devices/use-device.d.ts +5 -4
- package/lib/seam/devices/use-device.js +2 -3
- package/lib/seam/devices/use-device.js.map +1 -1
- package/lib/seam/devices/use-devices.d.ts +4 -3
- package/lib/seam/devices/use-devices.js +2 -3
- package/lib/seam/devices/use-devices.js.map +1 -1
- package/lib/seam/events/use-events.d.ts +5 -4
- package/lib/seam/events/use-events.js +5 -5
- package/lib/seam/events/use-events.js.map +1 -1
- package/lib/seam/filters.d.ts +7 -7
- package/lib/seam/filters.js.map +1 -1
- package/lib/seam/locks/lock-device.d.ts +5 -0
- package/lib/seam/locks/lock-device.js +2 -0
- package/lib/seam/locks/lock-device.js.map +1 -0
- package/lib/seam/locks/use-toggle-lock.d.ts +16 -0
- package/lib/seam/locks/use-toggle-lock.js +59 -0
- package/lib/seam/locks/use-toggle-lock.js.map +1 -0
- package/lib/seam/noise-sensors/noise-sensor-device.d.ts +5 -0
- package/lib/seam/noise-sensors/noise-sensor-device.js +2 -0
- package/lib/seam/noise-sensors/noise-sensor-device.js.map +1 -0
- package/lib/seam/noise-sensors/use-noise-thresholds.d.ts +4 -3
- package/lib/seam/noise-sensors/use-noise-thresholds.js +2 -3
- package/lib/seam/noise-sensors/use-noise-thresholds.js.map +1 -1
- package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.d.ts +3 -2
- package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.js +2 -10
- package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.js.map +1 -1
- package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.d.ts +3 -2
- package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js +3 -4
- package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js.map +1 -1
- package/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.d.ts +5 -3
- package/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.js +10 -6
- package/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.js.map +1 -1
- package/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.d.ts +5 -4
- package/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.js +13 -13
- package/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.js.map +1 -1
- package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.d.ts +5 -5
- package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.js +12 -17
- package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.js.map +1 -1
- package/lib/{temperature-bounds.d.ts → seam/thermostats/temperature-bounds.d.ts} +1 -1
- package/lib/{temperature-bounds.js → seam/thermostats/temperature-bounds.js} +4 -4
- package/lib/seam/thermostats/temperature-bounds.js.map +1 -0
- package/lib/seam/thermostats/thermostat-device.d.ts +17 -0
- package/lib/seam/thermostats/thermostat-device.js +2 -0
- package/lib/seam/thermostats/thermostat-device.js.map +1 -0
- package/lib/seam/thermostats/unit-conversion.d.ts +19 -0
- package/lib/seam/thermostats/unit-conversion.js +43 -0
- package/lib/seam/thermostats/unit-conversion.js.map +1 -0
- package/lib/seam/thermostats/use-cool-thermostat.d.ts +10 -4
- package/lib/seam/thermostats/use-cool-thermostat.js +34 -27
- package/lib/seam/thermostats/use-cool-thermostat.js.map +1 -1
- package/lib/seam/thermostats/use-heat-cool-thermostat.d.ts +10 -4
- package/lib/seam/thermostats/use-heat-cool-thermostat.js +34 -22
- package/lib/seam/thermostats/use-heat-cool-thermostat.js.map +1 -1
- package/lib/seam/thermostats/use-heat-thermostat.d.ts +10 -4
- package/lib/seam/thermostats/use-heat-thermostat.js +34 -27
- package/lib/seam/thermostats/use-heat-thermostat.js.map +1 -1
- package/lib/seam/thermostats/use-set-thermostat-fan-mode.d.ts +12 -0
- package/lib/seam/thermostats/use-set-thermostat-fan-mode.js +46 -0
- package/lib/seam/thermostats/use-set-thermostat-fan-mode.js.map +1 -0
- package/lib/seam/thermostats/use-set-thermostat-off.d.ts +10 -4
- package/lib/seam/thermostats/use-set-thermostat-off.js +36 -25
- package/lib/seam/thermostats/use-set-thermostat-off.js.map +1 -1
- package/lib/seam/thermostats/use-update-thermostat.d.ts +5 -5
- package/lib/seam/thermostats/use-update-thermostat.js +28 -27
- package/lib/seam/thermostats/use-update-thermostat.js.map +1 -1
- package/lib/seam/use-seam-client.d.ts +3 -3
- package/lib/seam/use-seam-client.js +5 -21
- package/lib/seam/use-seam-client.js.map +1 -1
- package/lib/seam/use-seam-query-result.d.ts +2 -2
- package/lib/ui/AccessCodeForm/AccessCodeForm.d.ts +5 -7
- package/lib/ui/AccessCodeForm/AccessCodeForm.js +9 -14
- package/lib/ui/AccessCodeForm/AccessCodeForm.js.map +1 -1
- package/lib/ui/AccessCodeForm/AccessCodeFormDatePicker.d.ts +1 -1
- package/lib/ui/AccessCodeForm/AccessCodeFormTimeZonePicker.d.ts +1 -1
- package/lib/ui/AccessCodeForm/AccessCodeFormTimes.d.ts +1 -1
- package/lib/ui/Checkbox.d.ts +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.d.ts +2 -2
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js.map +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.d.ts +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.js +3 -3
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.js.map +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.d.ts +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.js.map +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDeviceSelect.d.ts +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormNameAndSchedule.d.ts +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormTimeZonePicker.d.ts +1 -1
- package/lib/ui/ClimateSettingForm/set-point-bounds.d.ts +4 -0
- package/lib/ui/ClimateSettingForm/set-point-bounds.js +17 -0
- package/lib/ui/ClimateSettingForm/set-point-bounds.js.map +1 -0
- package/lib/ui/DateTimePicker/DateTimePicker.d.ts +1 -1
- package/lib/ui/FormField.d.ts +1 -1
- package/lib/ui/IconButton.d.ts +1 -1
- package/lib/ui/LoadingToast/LoadingToast.d.ts +1 -1
- package/lib/ui/RadioField/Radio.d.ts +1 -1
- package/lib/ui/RadioField/RadioField.d.ts +1 -1
- package/lib/ui/Snackbar/Snackbar.d.ts +1 -1
- package/lib/ui/Spinner/Spinner.d.ts +1 -1
- package/lib/ui/Switch/Switch.d.ts +1 -1
- package/lib/ui/TabSet.d.ts +1 -1
- package/lib/ui/Table/EmptyPlaceholder.d.ts +1 -1
- package/lib/ui/Table/TableCell.d.ts +1 -1
- package/lib/ui/Table/TableFilterBar/TableFilterBar.d.ts +1 -1
- package/lib/ui/Table/TableFilterBar/TableFilterItem.d.ts +1 -1
- package/lib/ui/Table/TableRow.d.ts +1 -1
- package/lib/ui/TextButton.d.ts +1 -1
- package/lib/ui/TextField/SearchTextField.d.ts +1 -1
- package/lib/ui/TimeZonePicker/TimeZonePicker.d.ts +1 -1
- package/lib/ui/clipboard.d.ts +1 -1
- package/lib/ui/clipboard.js +2 -2
- package/lib/ui/clipboard.js.map +1 -1
- package/lib/ui/device/BatteryStatusIndicator.d.ts +7 -0
- package/lib/ui/device/{BatteryStatus.js → BatteryStatusIndicator.js} +2 -2
- package/lib/ui/device/BatteryStatusIndicator.js.map +1 -0
- package/lib/ui/device/DeviceImage.d.ts +2 -2
- package/lib/ui/device/LockStatus.d.ts +3 -3
- package/lib/ui/device/LockStatus.js +1 -1
- package/lib/ui/device/LockStatus.js.map +1 -1
- package/lib/ui/device/NoiseLevelStatus.d.ts +2 -2
- package/lib/ui/device/NoiseLevelStatus.js +4 -4
- package/lib/ui/device/NoiseLevelStatus.js.map +1 -1
- package/lib/ui/device/OnlineStatus.d.ts +4 -4
- package/lib/ui/device/OnlineStatus.js.map +1 -1
- package/lib/ui/layout/ContentHeader.d.ts +1 -1
- package/lib/ui/layout/DotDivider.d.ts +1 -1
- package/lib/ui/noise-sensor/NoiseSensorActivityList.d.ts +2 -2
- package/lib/ui/noise-sensor/NoiseSensorActivityList.js +4 -2
- package/lib/ui/noise-sensor/NoiseSensorActivityList.js.map +1 -1
- package/lib/ui/noise-sensor/NoiseSensorEventItem.d.ts +6 -3
- package/lib/ui/noise-sensor/NoiseSensorEventItem.js +4 -7
- package/lib/ui/noise-sensor/NoiseSensorEventItem.js.map +1 -1
- package/lib/ui/noise-sensor/NoiseThresholdsList.d.ts +2 -2
- package/lib/ui/noise-sensor/NoiseThresholdsList.js.map +1 -1
- package/lib/ui/thermostat/ClimateModeMenu.d.ts +2 -2
- package/lib/ui/thermostat/ClimateModeMenu.js.map +1 -1
- package/lib/ui/thermostat/ClimateSettingControlGroup.d.ts +2 -2
- package/lib/ui/thermostat/ClimateSettingControlGroup.js.map +1 -1
- package/lib/ui/thermostat/ClimateSettingStatus.d.ts +2 -2
- package/lib/ui/thermostat/ClimateSettingStatus.js +2 -2
- package/lib/ui/thermostat/ClimateSettingStatus.js.map +1 -1
- package/lib/ui/thermostat/FanModeMenu.d.ts +2 -2
- package/lib/ui/thermostat/FanModeMenu.js.map +1 -1
- package/lib/ui/thermostat/Temperature.d.ts +1 -1
- package/lib/ui/thermostat/TemperatureControl.d.ts +1 -1
- package/lib/ui/thermostat/TemperatureControlGroup.d.ts +2 -2
- package/lib/ui/thermostat/TemperatureControlGroup.js +1 -1
- package/lib/ui/thermostat/TemperatureControlGroup.js.map +1 -1
- package/lib/ui/thermostat/ThermoModeMenuOption.d.ts +1 -1
- package/lib/ui/thermostat/ThermostatCard.d.ts +2 -2
- package/lib/ui/thermostat/ThermostatCard.js +5 -4
- package/lib/ui/thermostat/ThermostatCard.js.map +1 -1
- package/lib/ui/thermostat/ThermostatSelect.d.ts +1 -1
- package/lib/ui/thermostat/ThermostatSelect.js +2 -2
- package/lib/ui/thermostat/ThermostatSelect.js.map +1 -1
- package/lib/ui/typography/Title.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +8 -9
- package/src/index.scss +1 -1
- package/src/lib/object.ts +13 -0
- package/src/lib/seam/SeamProvider.tsx +9 -4
- package/src/lib/seam/access-codes/use-access-code.ts +10 -16
- package/src/lib/seam/access-codes/use-access-codes.ts +11 -18
- package/src/lib/seam/access-codes/use-create-access-code.ts +21 -16
- package/src/lib/seam/access-codes/use-delete-access-code.ts +22 -22
- package/src/lib/seam/access-codes/use-generate-access-code-code.ts +17 -21
- package/src/lib/seam/access-codes/use-update-access-code.ts +33 -25
- package/src/lib/seam/client-sessions/use-client-session.ts +5 -10
- package/src/lib/seam/components/AccessCodeDetails/AccessCodeDetails.tsx +36 -23
- package/src/lib/seam/components/AccessCodeDetails/AccessCodeDevice.tsx +10 -7
- package/src/lib/seam/components/AccessCodeTable/AccessCodeHealthBar.tsx +2 -3
- package/src/lib/seam/components/AccessCodeTable/AccessCodeMainIcon.tsx +3 -2
- package/src/lib/seam/components/AccessCodeTable/AccessCodeMenu.tsx +5 -4
- package/src/lib/seam/components/AccessCodeTable/AccessCodeRow.tsx +3 -2
- package/src/lib/seam/components/AccessCodeTable/AccessCodeTable.tsx +3 -7
- package/src/lib/seam/components/AccessCodeTable/CodeDetails.tsx +12 -8
- package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.tsx +4 -4
- package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.tsx +3 -3
- package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.tsx +6 -4
- package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRow.tsx +3 -2
- package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.tsx +1 -1
- package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.tsx +3 -6
- package/src/lib/seam/components/ConnectAccountButton/ConnectAccountButton.tsx +2 -2
- package/src/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.tsx +20 -16
- package/src/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.tsx +1 -1
- package/src/lib/seam/components/DeviceDetails/DeviceDetails.tsx +3 -2
- package/src/lib/seam/components/DeviceDetails/DeviceInfo.tsx +5 -3
- package/src/lib/seam/components/DeviceDetails/DeviceModel.tsx +2 -2
- package/src/lib/seam/components/DeviceDetails/LockDeviceDetails.tsx +6 -6
- package/src/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.tsx +1 -1
- package/src/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.tsx +7 -4
- package/src/lib/seam/components/DeviceTable/DeviceHealthBar.tsx +6 -3
- package/src/lib/seam/components/DeviceTable/DeviceRow.tsx +5 -7
- package/src/lib/seam/components/DeviceTable/DeviceTable.tsx +7 -14
- package/src/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.tsx +6 -7
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +3 -4
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.tsx +3 -2
- package/src/lib/seam/components/SupportedDeviceTable/use-device-model.ts +9 -14
- package/src/lib/seam/components/SupportedDeviceTable/use-device-models.ts +5 -9
- package/src/lib/seam/components/SupportedDeviceTable/use-manufacturer.ts +7 -12
- package/src/lib/seam/components/SupportedDeviceTable/use-manufacturers.ts +4 -8
- package/src/lib/seam/components/common-props.tsx +8 -4
- package/src/lib/seam/connect-webviews/use-create-connect-webview.ts +15 -17
- package/src/lib/seam/connected-accounts/use-connected-account.ts +17 -21
- package/src/lib/seam/devices/use-device-providers.ts +8 -11
- package/src/lib/seam/devices/use-device.ts +9 -18
- package/src/lib/seam/devices/use-devices.ts +20 -26
- package/src/lib/seam/events/use-events.ts +12 -14
- package/src/lib/seam/filters.ts +9 -8
- package/src/lib/seam/locks/lock-device.ts +9 -0
- package/src/lib/seam/locks/use-toggle-lock.ts +103 -0
- package/src/lib/seam/noise-sensors/noise-sensor-device.ts +10 -0
- package/src/lib/seam/noise-sensors/use-noise-thresholds.ts +12 -15
- package/src/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.ts +10 -23
- package/src/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.ts +13 -13
- package/src/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.ts +30 -25
- package/src/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.ts +26 -28
- package/src/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.ts +32 -41
- package/src/lib/{temperature-bounds.ts → seam/thermostats/temperature-bounds.ts} +8 -5
- package/src/lib/seam/thermostats/thermostat-device.ts +43 -0
- package/src/lib/seam/thermostats/unit-conversion.ts +89 -0
- package/src/lib/seam/thermostats/use-cool-thermostat.ts +77 -47
- package/src/lib/seam/thermostats/use-heat-cool-thermostat.ts +89 -40
- package/src/lib/seam/thermostats/use-heat-thermostat.ts +77 -47
- package/src/lib/seam/thermostats/use-set-thermostat-fan-mode.ts +95 -0
- package/src/lib/seam/thermostats/use-set-thermostat-off.ts +64 -40
- package/src/lib/seam/thermostats/use-update-thermostat.ts +47 -49
- package/src/lib/seam/use-seam-client.ts +11 -22
- package/src/lib/seam/use-seam-query-result.ts +2 -2
- package/src/lib/ui/AccessCodeForm/AccessCodeForm.tsx +18 -24
- package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.tsx +4 -4
- package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.tsx +6 -3
- package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.tsx +1 -1
- package/src/lib/ui/ClimateSettingForm/set-point-bounds.ts +31 -0
- package/src/lib/ui/clipboard.ts +1 -1
- package/src/lib/ui/device/{BatteryStatus.tsx → BatteryStatusIndicator.tsx} +10 -5
- package/src/lib/ui/device/DeviceImage.tsx +2 -2
- package/src/lib/ui/device/LockStatus.tsx +3 -2
- package/src/lib/ui/device/NoiseLevelStatus.tsx +3 -3
- package/src/lib/ui/device/OnlineStatus.tsx +3 -3
- package/src/lib/ui/noise-sensor/NoiseSensorActivityList.tsx +15 -6
- package/src/lib/ui/noise-sensor/NoiseSensorEventItem.tsx +13 -9
- package/src/lib/ui/noise-sensor/NoiseThresholdsList.tsx +4 -3
- package/src/lib/ui/thermostat/ClimateModeMenu.tsx +1 -2
- package/src/lib/ui/thermostat/ClimateSettingControlGroup.tsx +1 -2
- package/src/lib/ui/thermostat/ClimateSettingStatus.tsx +2 -3
- package/src/lib/ui/thermostat/FanModeMenu.tsx +1 -2
- package/src/lib/ui/thermostat/TemperatureControlGroup.tsx +2 -2
- package/src/lib/ui/thermostat/ThermostatCard.tsx +11 -8
- package/src/lib/ui/thermostat/ThermostatSelect.tsx +4 -10
- package/src/lib/version.ts +1 -1
- package/lib/seam/devices/use-toggle-lock.d.ts +0 -5
- package/lib/seam/devices/use-toggle-lock.js +0 -56
- package/lib/seam/devices/use-toggle-lock.js.map +0 -1
- package/lib/seam/error-handlers.d.ts +0 -5
- package/lib/seam/error-handlers.js +0 -12
- package/lib/seam/error-handlers.js.map +0 -1
- package/lib/seam/thermostats/use-update-fan-mode.d.ts +0 -6
- package/lib/seam/thermostats/use-update-fan-mode.js +0 -42
- package/lib/seam/thermostats/use-update-fan-mode.js.map +0 -1
- package/lib/set-point-bounds.d.ts +0 -4
- package/lib/set-point-bounds.js +0 -24
- package/lib/set-point-bounds.js.map +0 -1
- package/lib/temperature-bounds.js.map +0 -1
- package/lib/ui/device/BatteryStatus.d.ts +0 -7
- package/lib/ui/device/BatteryStatus.js.map +0 -1
- package/src/lib/seam/devices/use-toggle-lock.ts +0 -84
- package/src/lib/seam/error-handlers.ts +0 -19
- package/src/lib/seam/thermostats/use-update-fan-mode.ts +0 -81
- package/src/lib/set-point-bounds.ts +0 -39
|
@@ -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
|
|
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:
|
|
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,
|
|
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:
|
|
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:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
|
|
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,
|
|
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 {
|
|
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:
|
|
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(
|
|
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,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 {
|
|
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(
|
|
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
|
-
<
|
|
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 } =
|
|
209
|
+
const { mutate, isSuccess, isError } = useSetThermostatFanMode()
|
|
207
210
|
|
|
208
211
|
return (
|
|
209
212
|
<>
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import type {
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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 && <
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
} from 'lib/seam/
|
|
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:
|
|
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:
|
|
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
|
-
|
|
3
|
-
|
|
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:
|
|
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:
|
|
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,
|
|
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,
|
|
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 (
|
|
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:
|
|
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:
|
|
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
|
|
12
|
+
export type UseDeviceModelParams = DeviceModelsGetParams
|
|
13
|
+
|
|
13
14
|
export type UseDeviceModelData = DeviceModel | null
|
|
14
15
|
|
|
15
16
|
export function useDeviceModel(
|
|
16
|
-
params
|
|
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',
|
|
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
|
|
29
|
+
{ params }
|
|
35
30
|
)
|
|
36
|
-
|
|
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
|
|
12
|
+
export type UseManufacturerParams = ManufacturersGetParams
|
|
13
|
+
|
|
13
14
|
export type UseManufacturerData = Manufacturer | null
|
|
14
15
|
|
|
15
16
|
export function useManufacturer(
|
|
16
|
-
params
|
|
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',
|
|
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
|
|
29
|
+
{ params }
|
|
35
30
|
)
|
|
36
31
|
return manufacturer
|
|
37
32
|
},
|
|
@@ -1,15 +1,16 @@
|
|
|
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, 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 UseManufacturersParams = ManufacturersListParams
|
|
13
|
+
|
|
13
14
|
export type UseManufacturersData = Manufacturer[]
|
|
14
15
|
|
|
15
16
|
export function useManufacturers(
|
|
@@ -18,10 +19,7 @@ export function useManufacturers(
|
|
|
18
19
|
const { client: seam } = useSeamClient()
|
|
19
20
|
const queryClient = useQueryClient()
|
|
20
21
|
|
|
21
|
-
const { data, ...rest } = useQuery<
|
|
22
|
-
ManufacturersListResponse['manufacturers'],
|
|
23
|
-
SeamError
|
|
24
|
-
>({
|
|
22
|
+
const { data, ...rest } = useQuery<UseManufacturersData, SeamHttpApiError>({
|
|
25
23
|
enabled: seam != null,
|
|
26
24
|
queryKey: ['internal', 'manufacturers', 'list', params],
|
|
27
25
|
queryFn: async () => {
|
|
@@ -32,9 +30,6 @@ export function useManufacturers(
|
|
|
32
30
|
'/internal/devicedb/v1/manufacturers/list',
|
|
33
31
|
{ params }
|
|
34
32
|
)
|
|
35
|
-
return manufacturers
|
|
36
|
-
},
|
|
37
|
-
onSuccess: (manufacturers) => {
|
|
38
33
|
for (const manufacturer of manufacturers) {
|
|
39
34
|
queryClient.setQueryData(
|
|
40
35
|
[
|
|
@@ -46,6 +41,7 @@ export function useManufacturers(
|
|
|
46
41
|
manufacturer
|
|
47
42
|
)
|
|
48
43
|
}
|
|
44
|
+
return manufacturers
|
|
49
45
|
},
|
|
50
46
|
})
|
|
51
47
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type { ComponentType } from 'react'
|
|
2
1
|
import type {
|
|
3
2
|
AccessCodeError,
|
|
3
|
+
AccessCodeWarning,
|
|
4
4
|
ConnectedAccountError,
|
|
5
|
+
ConnectedAccountWarning,
|
|
5
6
|
DeviceError,
|
|
6
|
-
|
|
7
|
-
} from 'seamapi'
|
|
7
|
+
DeviceWarning,
|
|
8
|
+
} from '@seamapi/types/connect'
|
|
9
|
+
import type { ComponentType } from 'react'
|
|
8
10
|
|
|
9
11
|
export interface RequiredCommonProps {
|
|
10
12
|
className: string | undefined
|
|
@@ -12,7 +14,9 @@ export interface RequiredCommonProps {
|
|
|
12
14
|
errorFilter: (
|
|
13
15
|
error: ConnectedAccountError | DeviceError | AccessCodeError
|
|
14
16
|
) => boolean
|
|
15
|
-
warningFilter: (
|
|
17
|
+
warningFilter: (
|
|
18
|
+
warning: ConnectedAccountWarning | DeviceWarning | AccessCodeWarning
|
|
19
|
+
) => boolean
|
|
16
20
|
disableDeleteAccessCode: boolean | undefined
|
|
17
21
|
disableCreateAccessCode: boolean | undefined
|
|
18
22
|
disableEditAccessCode: boolean | undefined
|