From 12db40c8e9b67577d4e8ecb7237f3e192c5539f0 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Wed, 31 Jan 2024 23:08:09 +0000 Subject: [PATCH] ci: Generate code --- src/Objects/ActionAttempt.php | 2 +- src/Objects/DeviceProperties.php | 6 +- src/Objects/Phone.php | 2 - src/Objects/PhoneAccelerometerZ.php | 27 ---- .../PhoneActiveClimateSettingSchedule.php | 55 ------- src/Objects/PhoneAugustMetadata.php | 37 ----- src/Objects/PhoneAvigilonAltaMetadata.php | 35 ---- src/Objects/PhoneBattery.php | 27 ---- src/Objects/PhoneBrivoMetadata.php | 25 --- src/Objects/PhoneCodeConstraints.php | 29 ---- src/Objects/PhoneControlbywebMetadata.php | 29 ---- src/Objects/PhoneCurrentClimateSetting.php | 39 ----- src/Objects/PhoneDefaultClimateSetting.php | 39 ----- src/Objects/PhoneDormakabaOracodeMetadata.php | 40 ----- src/Objects/PhoneEcobeeMetadata.php | 27 ---- src/Objects/PhoneFourSuitesMetadata.php | 29 ---- src/Objects/PhoneGenieMetadata.php | 27 ---- src/Objects/PhoneHubitatMetadata.php | 29 ---- src/Objects/PhoneHumidity.php | 27 ---- src/Objects/PhoneIglooMetadata.php | 29 ---- src/Objects/PhoneIgloohomeMetadata.php | 31 ---- src/Objects/PhoneKeypadBattery.php | 25 --- src/Objects/PhoneKwiksetMetadata.php | 29 ---- src/Objects/PhoneLatestSensorValues.php | 33 ---- src/Objects/PhoneLocklyMetadata.php | 29 ---- src/Objects/PhoneMinutMetadata.php | 29 ---- src/Objects/PhoneModel.php | 33 ---- src/Objects/PhoneNestMetadata.php | 29 ---- src/Objects/PhoneNoiseawareMetadata.php | 33 ---- src/Objects/PhoneNukiMetadata.php | 29 ---- src/Objects/PhonePredefinedTimeSlots.php | 43 ----- src/Objects/PhonePressure.php | 27 ---- src/Objects/PhoneProperties.php | 149 ------------------ src/Objects/PhoneSaltoMetadata.php | 35 ---- src/Objects/PhoneSchlageMetadata.php | 31 ---- src/Objects/PhoneSeamBridgeMetadata.php | 29 ---- src/Objects/PhoneSmartthingsMetadata.php | 31 ---- src/Objects/PhoneSound.php | 27 ---- src/Objects/PhoneTemperature.php | 27 ---- src/Objects/PhoneTtlockMetadata.php | 27 ---- src/Objects/PhoneTwoNMetadata.php | 27 ---- src/Objects/PhoneWyzeMetadata.php | 35 ---- src/SeamClient.php | 124 ++++++++++++--- 43 files changed, 110 insertions(+), 1362 deletions(-) delete mode 100644 src/Objects/PhoneAccelerometerZ.php delete mode 100644 src/Objects/PhoneActiveClimateSettingSchedule.php delete mode 100644 src/Objects/PhoneAugustMetadata.php delete mode 100644 src/Objects/PhoneAvigilonAltaMetadata.php delete mode 100644 src/Objects/PhoneBattery.php delete mode 100644 src/Objects/PhoneBrivoMetadata.php delete mode 100644 src/Objects/PhoneCodeConstraints.php delete mode 100644 src/Objects/PhoneControlbywebMetadata.php delete mode 100644 src/Objects/PhoneCurrentClimateSetting.php delete mode 100644 src/Objects/PhoneDefaultClimateSetting.php delete mode 100644 src/Objects/PhoneDormakabaOracodeMetadata.php delete mode 100644 src/Objects/PhoneEcobeeMetadata.php delete mode 100644 src/Objects/PhoneFourSuitesMetadata.php delete mode 100644 src/Objects/PhoneGenieMetadata.php delete mode 100644 src/Objects/PhoneHubitatMetadata.php delete mode 100644 src/Objects/PhoneHumidity.php delete mode 100644 src/Objects/PhoneIglooMetadata.php delete mode 100644 src/Objects/PhoneIgloohomeMetadata.php delete mode 100644 src/Objects/PhoneKeypadBattery.php delete mode 100644 src/Objects/PhoneKwiksetMetadata.php delete mode 100644 src/Objects/PhoneLatestSensorValues.php delete mode 100644 src/Objects/PhoneLocklyMetadata.php delete mode 100644 src/Objects/PhoneMinutMetadata.php delete mode 100644 src/Objects/PhoneModel.php delete mode 100644 src/Objects/PhoneNestMetadata.php delete mode 100644 src/Objects/PhoneNoiseawareMetadata.php delete mode 100644 src/Objects/PhoneNukiMetadata.php delete mode 100644 src/Objects/PhonePredefinedTimeSlots.php delete mode 100644 src/Objects/PhonePressure.php delete mode 100644 src/Objects/PhoneSaltoMetadata.php delete mode 100644 src/Objects/PhoneSchlageMetadata.php delete mode 100644 src/Objects/PhoneSeamBridgeMetadata.php delete mode 100644 src/Objects/PhoneSmartthingsMetadata.php delete mode 100644 src/Objects/PhoneSound.php delete mode 100644 src/Objects/PhoneTemperature.php delete mode 100644 src/Objects/PhoneTtlockMetadata.php delete mode 100644 src/Objects/PhoneTwoNMetadata.php delete mode 100644 src/Objects/PhoneWyzeMetadata.php diff --git a/src/Objects/ActionAttempt.php b/src/Objects/ActionAttempt.php index fd4a22f..fe8c5b2 100644 --- a/src/Objects/ActionAttempt.php +++ b/src/Objects/ActionAttempt.php @@ -25,7 +25,7 @@ public function __construct( public string | null $status, public string | null $action_type, public string | null $action_attempt_id, - public string | null $result, + public mixed $result, public ActionAttemptError | null $error, ) { } diff --git a/src/Objects/DeviceProperties.php b/src/Objects/DeviceProperties.php index b4ac76d..e22409e 100644 --- a/src/Objects/DeviceProperties.php +++ b/src/Objects/DeviceProperties.php @@ -25,6 +25,7 @@ public static function from_json(mixed $json): DeviceProperties|null offline_access_codes_enabled: $json->offline_access_codes_enabled ?? null, supports_accessory_keypad: $json->supports_accessory_keypad ?? null, supports_offline_access_codes: $json->supports_offline_access_codes ?? null, + assa_abloy_credential_service_metadata: isset($json->assa_abloy_credential_service_metadata) ? DeviceAssaAbloyCredentialServiceMetadata::from_json($json->assa_abloy_credential_service_metadata) : null, august_metadata: isset($json->august_metadata) ? DeviceAugustMetadata::from_json($json->august_metadata) : null, avigilon_alta_metadata: isset($json->avigilon_alta_metadata) ? DeviceAvigilonAltaMetadata::from_json($json->avigilon_alta_metadata) : null, schlage_metadata: isset($json->schlage_metadata) ? DeviceSchlageMetadata::from_json($json->schlage_metadata) : null, @@ -49,6 +50,7 @@ public static function from_json(mixed $json): DeviceProperties|null hubitat_metadata: isset($json->hubitat_metadata) ? DeviceHubitatMetadata::from_json($json->hubitat_metadata) : null, dormakaba_oracode_metadata: isset($json->dormakaba_oracode_metadata) ? DeviceDormakabaOracodeMetadata::from_json($json->dormakaba_oracode_metadata) : null, wyze_metadata: isset($json->wyze_metadata) ? DeviceWyzeMetadata::from_json($json->wyze_metadata) : null, + _experimental_supported_code_from_access_codes_lengths: $json->_experimental_supported_code_from_access_codes_lengths ?? null, code_constraints: array_map( fn ($c) => DeviceCodeConstraints::from_json($c), $json->code_constraints ?? [] @@ -87,7 +89,6 @@ public static function from_json(mixed $json): DeviceProperties|null max_heating_set_point_fahrenheit: $json->max_heating_set_point_fahrenheit ?? null, min_heating_cooling_delta_celsius: $json->min_heating_cooling_delta_celsius ?? null, min_heating_cooling_delta_fahrenheit: $json->min_heating_cooling_delta_fahrenheit ?? null, - assa_abloy_credential_service_metadata: isset($json->assa_abloy_credential_service_metadata) ? DeviceAssaAbloyCredentialServiceMetadata::from_json($json->assa_abloy_credential_service_metadata) : null, ); } @@ -108,6 +109,7 @@ public function __construct( public bool | null $offline_access_codes_enabled, public bool | null $supports_accessory_keypad, public bool | null $supports_offline_access_codes, + public DeviceAssaAbloyCredentialServiceMetadata | null $assa_abloy_credential_service_metadata, public DeviceAugustMetadata | null $august_metadata, public DeviceAvigilonAltaMetadata | null $avigilon_alta_metadata, public DeviceSchlageMetadata | null $schlage_metadata, @@ -132,6 +134,7 @@ public function __construct( public DeviceHubitatMetadata | null $hubitat_metadata, public DeviceDormakabaOracodeMetadata | null $dormakaba_oracode_metadata, public DeviceWyzeMetadata | null $wyze_metadata, + public array | null $_experimental_supported_code_from_access_codes_lengths, public array | null $code_constraints, public array | null $supported_code_lengths, public float | null $max_active_codes_supported, @@ -167,7 +170,6 @@ public function __construct( public float | null $max_heating_set_point_fahrenheit, public float | null $min_heating_cooling_delta_celsius, public float | null $min_heating_cooling_delta_fahrenheit, - public DeviceAssaAbloyCredentialServiceMetadata | null $assa_abloy_credential_service_metadata, ) { } diff --git a/src/Objects/Phone.php b/src/Objects/Phone.php index fc8e4b3..e716dff 100644 --- a/src/Objects/Phone.php +++ b/src/Objects/Phone.php @@ -28,7 +28,6 @@ public static function from_json(mixed $json): Phone|null created_at: $json->created_at, is_managed: $json->is_managed, custom_metadata: $json->custom_metadata ?? null, - assa_abloy_credential_service_metadata: isset($json->assa_abloy_credential_service_metadata) ? PhoneAssaAbloyCredentialServiceMetadata::from_json($json->assa_abloy_credential_service_metadata) : null, ); } @@ -46,7 +45,6 @@ public function __construct( public string $created_at, public bool $is_managed, public mixed $custom_metadata, - public PhoneAssaAbloyCredentialServiceMetadata | null $assa_abloy_credential_service_metadata, ) { } diff --git a/src/Objects/PhoneAccelerometerZ.php b/src/Objects/PhoneAccelerometerZ.php deleted file mode 100644 index a061f42..0000000 --- a/src/Objects/PhoneAccelerometerZ.php +++ /dev/null @@ -1,27 +0,0 @@ -time, - value: $json->value, - ); - } - - - - public function __construct( - public string $time, - public float $value, - ) { - } - -} diff --git a/src/Objects/PhoneActiveClimateSettingSchedule.php b/src/Objects/PhoneActiveClimateSettingSchedule.php deleted file mode 100644 index ee23b32..0000000 --- a/src/Objects/PhoneActiveClimateSettingSchedule.php +++ /dev/null @@ -1,55 +0,0 @@ -climate_setting_schedule_id, - schedule_type: $json->schedule_type, - device_id: $json->device_id, - name: $json->name ?? null, - schedule_starts_at: $json->schedule_starts_at, - schedule_ends_at: $json->schedule_ends_at, - created_at: $json->created_at, - errors: $json->errors ?? null, - automatic_heating_enabled: $json->automatic_heating_enabled ?? null, - automatic_cooling_enabled: $json->automatic_cooling_enabled ?? null, - hvac_mode_setting: $json->hvac_mode_setting ?? null, - cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, - heating_set_point_celsius: $json->heating_set_point_celsius ?? null, - cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, - heating_set_point_fahrenheit: $json->heating_set_point_fahrenheit ?? null, - manual_override_allowed: $json->manual_override_allowed ?? null, - ); - } - - - - public function __construct( - public string $climate_setting_schedule_id, - public string $schedule_type, - public string $device_id, - public string | null $name, - public string $schedule_starts_at, - public string $schedule_ends_at, - public string $created_at, - public mixed $errors, - public bool | null $automatic_heating_enabled, - public bool | null $automatic_cooling_enabled, - public string | null $hvac_mode_setting, - public float | null $cooling_set_point_celsius, - public float | null $heating_set_point_celsius, - public float | null $cooling_set_point_fahrenheit, - public float | null $heating_set_point_fahrenheit, - public bool | null $manual_override_allowed, - ) { - } - -} diff --git a/src/Objects/PhoneAugustMetadata.php b/src/Objects/PhoneAugustMetadata.php deleted file mode 100644 index 73c81ea..0000000 --- a/src/Objects/PhoneAugustMetadata.php +++ /dev/null @@ -1,37 +0,0 @@ -lock_id, - lock_name: $json->lock_name, - house_name: $json->house_name, - has_keypad: $json->has_keypad, - keypad_battery_level: $json->keypad_battery_level ?? null, - model: $json->model ?? null, - house_id: $json->house_id ?? null, - ); - } - - - - public function __construct( - public string $lock_id, - public string $lock_name, - public string $house_name, - public bool $has_keypad, - public string | null $keypad_battery_level, - public string | null $model, - public string | null $house_id, - ) { - } - -} diff --git a/src/Objects/PhoneAvigilonAltaMetadata.php b/src/Objects/PhoneAvigilonAltaMetadata.php deleted file mode 100644 index 5825db7..0000000 --- a/src/Objects/PhoneAvigilonAltaMetadata.php +++ /dev/null @@ -1,35 +0,0 @@ -entry_name, - org_name: $json->org_name, - zone_id: $json->zone_id, - zone_name: $json->zone_name, - site_id: $json->site_id, - site_name: $json->site_name, - ); - } - - - - public function __construct( - public string $entry_name, - public string $org_name, - public float $zone_id, - public string $zone_name, - public float $site_id, - public string $site_name, - ) { - } - -} diff --git a/src/Objects/PhoneBattery.php b/src/Objects/PhoneBattery.php deleted file mode 100644 index 302238d..0000000 --- a/src/Objects/PhoneBattery.php +++ /dev/null @@ -1,27 +0,0 @@ -level, - status: $json->status, - ); - } - - - - public function __construct( - public float $level, - public string $status, - ) { - } - -} diff --git a/src/Objects/PhoneBrivoMetadata.php b/src/Objects/PhoneBrivoMetadata.php deleted file mode 100644 index 6ebb9e5..0000000 --- a/src/Objects/PhoneBrivoMetadata.php +++ /dev/null @@ -1,25 +0,0 @@ -device_name, - ); - } - - - - public function __construct( - public string $device_name, - ) { - } - -} diff --git a/src/Objects/PhoneCodeConstraints.php b/src/Objects/PhoneCodeConstraints.php deleted file mode 100644 index 0e46be3..0000000 --- a/src/Objects/PhoneCodeConstraints.php +++ /dev/null @@ -1,29 +0,0 @@ -constraint_type, - min_length: $json->min_length ?? null, - max_length: $json->max_length ?? null, - ); - } - - - - public function __construct( - public string $constraint_type, - public float | null $min_length, - public float | null $max_length, - ) { - } - -} diff --git a/src/Objects/PhoneControlbywebMetadata.php b/src/Objects/PhoneControlbywebMetadata.php deleted file mode 100644 index 699deb8..0000000 --- a/src/Objects/PhoneControlbywebMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - device_name: $json->device_name, - relay_name: $json->relay_name ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public string | null $relay_name, - ) { - } - -} diff --git a/src/Objects/PhoneCurrentClimateSetting.php b/src/Objects/PhoneCurrentClimateSetting.php deleted file mode 100644 index 8939aa7..0000000 --- a/src/Objects/PhoneCurrentClimateSetting.php +++ /dev/null @@ -1,39 +0,0 @@ -automatic_heating_enabled, - automatic_cooling_enabled: $json->automatic_cooling_enabled, - hvac_mode_setting: $json->hvac_mode_setting, - cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, - heating_set_point_celsius: $json->heating_set_point_celsius ?? null, - cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, - heating_set_point_fahrenheit: $json->heating_set_point_fahrenheit ?? null, - manual_override_allowed: $json->manual_override_allowed, - ); - } - - - - public function __construct( - public bool $automatic_heating_enabled, - public bool $automatic_cooling_enabled, - public string $hvac_mode_setting, - public float | null $cooling_set_point_celsius, - public float | null $heating_set_point_celsius, - public float | null $cooling_set_point_fahrenheit, - public float | null $heating_set_point_fahrenheit, - public bool $manual_override_allowed, - ) { - } - -} diff --git a/src/Objects/PhoneDefaultClimateSetting.php b/src/Objects/PhoneDefaultClimateSetting.php deleted file mode 100644 index 9cd73a2..0000000 --- a/src/Objects/PhoneDefaultClimateSetting.php +++ /dev/null @@ -1,39 +0,0 @@ -automatic_heating_enabled, - automatic_cooling_enabled: $json->automatic_cooling_enabled, - hvac_mode_setting: $json->hvac_mode_setting, - cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, - heating_set_point_celsius: $json->heating_set_point_celsius ?? null, - cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, - heating_set_point_fahrenheit: $json->heating_set_point_fahrenheit ?? null, - manual_override_allowed: $json->manual_override_allowed, - ); - } - - - - public function __construct( - public bool $automatic_heating_enabled, - public bool $automatic_cooling_enabled, - public string $hvac_mode_setting, - public float | null $cooling_set_point_celsius, - public float | null $heating_set_point_celsius, - public float | null $cooling_set_point_fahrenheit, - public float | null $heating_set_point_fahrenheit, - public bool $manual_override_allowed, - ) { - } - -} diff --git a/src/Objects/PhoneDormakabaOracodeMetadata.php b/src/Objects/PhoneDormakabaOracodeMetadata.php deleted file mode 100644 index a915061..0000000 --- a/src/Objects/PhoneDormakabaOracodeMetadata.php +++ /dev/null @@ -1,40 +0,0 @@ -door_id, - door_name: $json->door_name, - device_id: $json->device_id ?? null, - site_id: $json->site_id, - site_name: $json->site_name, - iana_timezone: $json->iana_timezone ?? null, - predefined_time_slots: array_map( - fn ($p) => PhonePredefinedTimeSlots::from_json($p), - $json->predefined_time_slots ?? [] - ), - ); - } - - - - public function __construct( - public float $door_id, - public string $door_name, - public float | null $device_id, - public float $site_id, - public string $site_name, - public string | null $iana_timezone, - public array | null $predefined_time_slots, - ) { - } - -} diff --git a/src/Objects/PhoneEcobeeMetadata.php b/src/Objects/PhoneEcobeeMetadata.php deleted file mode 100644 index 68aa3e3..0000000 --- a/src/Objects/PhoneEcobeeMetadata.php +++ /dev/null @@ -1,27 +0,0 @@ -ecobee_device_id, - device_name: $json->device_name, - ); - } - - - - public function __construct( - public string $ecobee_device_id, - public string $device_name, - ) { - } - -} diff --git a/src/Objects/PhoneFourSuitesMetadata.php b/src/Objects/PhoneFourSuitesMetadata.php deleted file mode 100644 index 2a3f6d2..0000000 --- a/src/Objects/PhoneFourSuitesMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - device_name: $json->device_name, - reclose_delay_in_seconds: $json->reclose_delay_in_seconds, - ); - } - - - - public function __construct( - public float $device_id, - public string $device_name, - public float $reclose_delay_in_seconds, - ) { - } - -} diff --git a/src/Objects/PhoneGenieMetadata.php b/src/Objects/PhoneGenieMetadata.php deleted file mode 100644 index 8cbd40d..0000000 --- a/src/Objects/PhoneGenieMetadata.php +++ /dev/null @@ -1,27 +0,0 @@ -device_name, - door_name: $json->door_name, - ); - } - - - - public function __construct( - public string $device_name, - public string $door_name, - ) { - } - -} diff --git a/src/Objects/PhoneHubitatMetadata.php b/src/Objects/PhoneHubitatMetadata.php deleted file mode 100644 index 2c5b818..0000000 --- a/src/Objects/PhoneHubitatMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - device_name: $json->device_name, - device_label: $json->device_label, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public string $device_label, - ) { - } - -} diff --git a/src/Objects/PhoneHumidity.php b/src/Objects/PhoneHumidity.php deleted file mode 100644 index d5fe749..0000000 --- a/src/Objects/PhoneHumidity.php +++ /dev/null @@ -1,27 +0,0 @@ -time, - value: $json->value, - ); - } - - - - public function __construct( - public string $time, - public float $value, - ) { - } - -} diff --git a/src/Objects/PhoneIglooMetadata.php b/src/Objects/PhoneIglooMetadata.php deleted file mode 100644 index 3380822..0000000 --- a/src/Objects/PhoneIglooMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - bridge_id: $json->bridge_id, - model: $json->model ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $bridge_id, - public string | null $model, - ) { - } - -} diff --git a/src/Objects/PhoneIgloohomeMetadata.php b/src/Objects/PhoneIgloohomeMetadata.php deleted file mode 100644 index 98f87b1..0000000 --- a/src/Objects/PhoneIgloohomeMetadata.php +++ /dev/null @@ -1,31 +0,0 @@ -device_id, - device_name: $json->device_name, - bridge_id: $json->bridge_id ?? null, - bridge_name: $json->bridge_name ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public string | null $bridge_id, - public string | null $bridge_name, - ) { - } - -} diff --git a/src/Objects/PhoneKeypadBattery.php b/src/Objects/PhoneKeypadBattery.php deleted file mode 100644 index 570a5cc..0000000 --- a/src/Objects/PhoneKeypadBattery.php +++ /dev/null @@ -1,25 +0,0 @@ -level, - ); - } - - - - public function __construct( - public float $level, - ) { - } - -} diff --git a/src/Objects/PhoneKwiksetMetadata.php b/src/Objects/PhoneKwiksetMetadata.php deleted file mode 100644 index 7f35706..0000000 --- a/src/Objects/PhoneKwiksetMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - device_name: $json->device_name, - model_number: $json->model_number, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public string $model_number, - ) { - } - -} diff --git a/src/Objects/PhoneLatestSensorValues.php b/src/Objects/PhoneLatestSensorValues.php deleted file mode 100644 index 1170838..0000000 --- a/src/Objects/PhoneLatestSensorValues.php +++ /dev/null @@ -1,33 +0,0 @@ -temperature), - sound: PhoneSound::from_json($json->sound), - humidity: PhoneHumidity::from_json($json->humidity), - pressure: PhonePressure::from_json($json->pressure), - accelerometer_z: PhoneAccelerometerZ::from_json($json->accelerometer_z), - ); - } - - - - public function __construct( - public PhoneTemperature $temperature, - public PhoneSound $sound, - public PhoneHumidity $humidity, - public PhonePressure $pressure, - public PhoneAccelerometerZ $accelerometer_z, - ) { - } - -} diff --git a/src/Objects/PhoneLocklyMetadata.php b/src/Objects/PhoneLocklyMetadata.php deleted file mode 100644 index d5dc1a4..0000000 --- a/src/Objects/PhoneLocklyMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - device_name: $json->device_name, - model: $json->model ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public string | null $model, - ) { - } - -} diff --git a/src/Objects/PhoneMinutMetadata.php b/src/Objects/PhoneMinutMetadata.php deleted file mode 100644 index 0c14f9f..0000000 --- a/src/Objects/PhoneMinutMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - device_name: $json->device_name, - latest_sensor_values: PhoneLatestSensorValues::from_json($json->latest_sensor_values), - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public PhoneLatestSensorValues $latest_sensor_values, - ) { - } - -} diff --git a/src/Objects/PhoneModel.php b/src/Objects/PhoneModel.php deleted file mode 100644 index aa08495..0000000 --- a/src/Objects/PhoneModel.php +++ /dev/null @@ -1,33 +0,0 @@ -display_name, - manufacturer_display_name: $json->manufacturer_display_name, - offline_access_codes_supported: $json->offline_access_codes_supported ?? null, - online_access_codes_supported: $json->online_access_codes_supported ?? null, - accessory_keypad_supported: $json->accessory_keypad_supported ?? null, - ); - } - - - - public function __construct( - public string $display_name, - public string $manufacturer_display_name, - public bool | null $offline_access_codes_supported, - public bool | null $online_access_codes_supported, - public bool | null $accessory_keypad_supported, - ) { - } - -} diff --git a/src/Objects/PhoneNestMetadata.php b/src/Objects/PhoneNestMetadata.php deleted file mode 100644 index bc976b4..0000000 --- a/src/Objects/PhoneNestMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -nest_device_id, - device_name: $json->device_name, - custom_name: $json->custom_name, - ); - } - - - - public function __construct( - public string $nest_device_id, - public string $device_name, - public string $custom_name, - ) { - } - -} diff --git a/src/Objects/PhoneNoiseawareMetadata.php b/src/Objects/PhoneNoiseawareMetadata.php deleted file mode 100644 index 7be2b9b..0000000 --- a/src/Objects/PhoneNoiseawareMetadata.php +++ /dev/null @@ -1,33 +0,0 @@ -device_model, - noise_level_nrs: $json->noise_level_nrs, - noise_level_decibel: $json->noise_level_decibel, - device_name: $json->device_name, - device_id: $json->device_id, - ); - } - - - - public function __construct( - public string $device_model, - public float $noise_level_nrs, - public float $noise_level_decibel, - public string $device_name, - public string $device_id, - ) { - } - -} diff --git a/src/Objects/PhoneNukiMetadata.php b/src/Objects/PhoneNukiMetadata.php deleted file mode 100644 index d4993d6..0000000 --- a/src/Objects/PhoneNukiMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -device_id, - device_name: $json->device_name, - keypad_battery_critical: $json->keypad_battery_critical ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public bool | null $keypad_battery_critical, - ) { - } - -} diff --git a/src/Objects/PhonePredefinedTimeSlots.php b/src/Objects/PhonePredefinedTimeSlots.php deleted file mode 100644 index 2d4ca76..0000000 --- a/src/Objects/PhonePredefinedTimeSlots.php +++ /dev/null @@ -1,43 +0,0 @@ -name, - prefix: $json->prefix, - check_in_time: $json->check_in_time, - check_out_time: $json->check_out_time, - is_24_hour: $json->is_24_hour, - is_biweekly_mode: $json->is_biweekly_mode, - is_one_shot: $json->is_one_shot, - is_master: $json->is_master, - ext_dormakaba_oracode_user_level_prefix: $json->ext_dormakaba_oracode_user_level_prefix, - dormakaba_oracode_user_level_id: $json->dormakaba_oracode_user_level_id, - ); - } - - - - public function __construct( - public string $name, - public float $prefix, - public string $check_in_time, - public string $check_out_time, - public bool $is_24_hour, - public bool $is_biweekly_mode, - public bool $is_one_shot, - public bool $is_master, - public float $ext_dormakaba_oracode_user_level_prefix, - public string $dormakaba_oracode_user_level_id, - ) { - } - -} diff --git a/src/Objects/PhonePressure.php b/src/Objects/PhonePressure.php deleted file mode 100644 index 5576185..0000000 --- a/src/Objects/PhonePressure.php +++ /dev/null @@ -1,27 +0,0 @@ -time, - value: $json->value, - ); - } - - - - public function __construct( - public string $time, - public float $value, - ) { - } - -} diff --git a/src/Objects/PhoneProperties.php b/src/Objects/PhoneProperties.php index 331cfde..0dea6a2 100644 --- a/src/Objects/PhoneProperties.php +++ b/src/Objects/PhoneProperties.php @@ -11,82 +11,6 @@ public static function from_json(mixed $json): PhoneProperties|null return null; } return new self( - online: $json->online, - name: $json->name, - model: PhoneModel::from_json($json->model), - has_direct_power: $json->has_direct_power ?? null, - battery_level: $json->battery_level ?? null, - battery: isset($json->battery) ? PhoneBattery::from_json($json->battery) : null, - manufacturer: $json->manufacturer ?? null, - image_url: $json->image_url ?? null, - image_alt_text: $json->image_alt_text ?? null, - serial_number: $json->serial_number ?? null, - online_access_codes_enabled: $json->online_access_codes_enabled ?? null, - offline_access_codes_enabled: $json->offline_access_codes_enabled ?? null, - supports_accessory_keypad: $json->supports_accessory_keypad ?? null, - supports_offline_access_codes: $json->supports_offline_access_codes ?? null, - august_metadata: isset($json->august_metadata) ? PhoneAugustMetadata::from_json($json->august_metadata) : null, - avigilon_alta_metadata: isset($json->avigilon_alta_metadata) ? PhoneAvigilonAltaMetadata::from_json($json->avigilon_alta_metadata) : null, - schlage_metadata: isset($json->schlage_metadata) ? PhoneSchlageMetadata::from_json($json->schlage_metadata) : null, - smartthings_metadata: isset($json->smartthings_metadata) ? PhoneSmartthingsMetadata::from_json($json->smartthings_metadata) : null, - lockly_metadata: isset($json->lockly_metadata) ? PhoneLocklyMetadata::from_json($json->lockly_metadata) : null, - nuki_metadata: isset($json->nuki_metadata) ? PhoneNukiMetadata::from_json($json->nuki_metadata) : null, - kwikset_metadata: isset($json->kwikset_metadata) ? PhoneKwiksetMetadata::from_json($json->kwikset_metadata) : null, - salto_metadata: isset($json->salto_metadata) ? PhoneSaltoMetadata::from_json($json->salto_metadata) : null, - genie_metadata: isset($json->genie_metadata) ? PhoneGenieMetadata::from_json($json->genie_metadata) : null, - brivo_metadata: isset($json->brivo_metadata) ? PhoneBrivoMetadata::from_json($json->brivo_metadata) : null, - igloo_metadata: isset($json->igloo_metadata) ? PhoneIglooMetadata::from_json($json->igloo_metadata) : null, - noiseaware_metadata: isset($json->noiseaware_metadata) ? PhoneNoiseawareMetadata::from_json($json->noiseaware_metadata) : null, - minut_metadata: isset($json->minut_metadata) ? PhoneMinutMetadata::from_json($json->minut_metadata) : null, - four_suites_metadata: isset($json->four_suites_metadata) ? PhoneFourSuitesMetadata::from_json($json->four_suites_metadata) : null, - two_n_metadata: isset($json->two_n_metadata) ? PhoneTwoNMetadata::from_json($json->two_n_metadata) : null, - controlbyweb_metadata: isset($json->controlbyweb_metadata) ? PhoneControlbywebMetadata::from_json($json->controlbyweb_metadata) : null, - ttlock_metadata: isset($json->ttlock_metadata) ? PhoneTtlockMetadata::from_json($json->ttlock_metadata) : null, - seam_bridge_metadata: isset($json->seam_bridge_metadata) ? PhoneSeamBridgeMetadata::from_json($json->seam_bridge_metadata) : null, - igloohome_metadata: isset($json->igloohome_metadata) ? PhoneIgloohomeMetadata::from_json($json->igloohome_metadata) : null, - nest_metadata: isset($json->nest_metadata) ? PhoneNestMetadata::from_json($json->nest_metadata) : null, - ecobee_metadata: isset($json->ecobee_metadata) ? PhoneEcobeeMetadata::from_json($json->ecobee_metadata) : null, - hubitat_metadata: isset($json->hubitat_metadata) ? PhoneHubitatMetadata::from_json($json->hubitat_metadata) : null, - dormakaba_oracode_metadata: isset($json->dormakaba_oracode_metadata) ? PhoneDormakabaOracodeMetadata::from_json($json->dormakaba_oracode_metadata) : null, - wyze_metadata: isset($json->wyze_metadata) ? PhoneWyzeMetadata::from_json($json->wyze_metadata) : null, - code_constraints: array_map( - fn ($c) => PhoneCodeConstraints::from_json($c), - $json->code_constraints ?? [] - ), - supported_code_lengths: $json->supported_code_lengths ?? null, - max_active_codes_supported: $json->max_active_codes_supported ?? null, - supports_backup_access_code_pool: $json->supports_backup_access_code_pool ?? null, - has_native_entry_events: $json->has_native_entry_events ?? null, - locked: $json->locked ?? null, - keypad_battery: isset($json->keypad_battery) ? PhoneKeypadBattery::from_json($json->keypad_battery) : null, - door_open: $json->door_open ?? null, - temperature_fahrenheit: $json->temperature_fahrenheit ?? null, - temperature_celsius: $json->temperature_celsius ?? null, - relative_humidity: $json->relative_humidity ?? null, - can_enable_automatic_heating: $json->can_enable_automatic_heating ?? null, - can_enable_automatic_cooling: $json->can_enable_automatic_cooling ?? null, - available_hvac_mode_settings: $json->available_hvac_mode_settings ?? null, - is_heating_available: $json->is_heating_available ?? null, - is_cooling_available: $json->is_cooling_available ?? null, - is_heating: $json->is_heating ?? null, - is_cooling: $json->is_cooling ?? null, - is_fan_running: $json->is_fan_running ?? null, - fan_mode_setting: $json->fan_mode_setting ?? null, - is_temporary_manual_override_active: $json->is_temporary_manual_override_active ?? null, - current_climate_setting: isset($json->current_climate_setting) ? PhoneCurrentClimateSetting::from_json($json->current_climate_setting) : null, - default_climate_setting: isset($json->default_climate_setting) ? PhoneDefaultClimateSetting::from_json($json->default_climate_setting) : null, - is_climate_setting_schedule_active: $json->is_climate_setting_schedule_active ?? null, - active_climate_setting_schedule: isset($json->active_climate_setting_schedule) ? PhoneActiveClimateSettingSchedule::from_json($json->active_climate_setting_schedule) : null, - min_cooling_set_point_celsius: $json->min_cooling_set_point_celsius ?? null, - min_cooling_set_point_fahrenheit: $json->min_cooling_set_point_fahrenheit ?? null, - max_cooling_set_point_celsius: $json->max_cooling_set_point_celsius ?? null, - max_cooling_set_point_fahrenheit: $json->max_cooling_set_point_fahrenheit ?? null, - min_heating_set_point_celsius: $json->min_heating_set_point_celsius ?? null, - min_heating_set_point_fahrenheit: $json->min_heating_set_point_fahrenheit ?? null, - max_heating_set_point_celsius: $json->max_heating_set_point_celsius ?? null, - max_heating_set_point_fahrenheit: $json->max_heating_set_point_fahrenheit ?? null, - min_heating_cooling_delta_celsius: $json->min_heating_cooling_delta_celsius ?? null, - min_heating_cooling_delta_fahrenheit: $json->min_heating_cooling_delta_fahrenheit ?? null, assa_abloy_credential_service_metadata: isset($json->assa_abloy_credential_service_metadata) ? PhoneAssaAbloyCredentialServiceMetadata::from_json($json->assa_abloy_credential_service_metadata) : null, ); } @@ -94,79 +18,6 @@ public static function from_json(mixed $json): PhoneProperties|null public function __construct( - public bool $online, - public string $name, - public PhoneModel $model, - public bool | null $has_direct_power, - public float | null $battery_level, - public PhoneBattery | null $battery, - public string | null $manufacturer, - public string | null $image_url, - public string | null $image_alt_text, - public string | null $serial_number, - public bool | null $online_access_codes_enabled, - public bool | null $offline_access_codes_enabled, - public bool | null $supports_accessory_keypad, - public bool | null $supports_offline_access_codes, - public PhoneAugustMetadata | null $august_metadata, - public PhoneAvigilonAltaMetadata | null $avigilon_alta_metadata, - public PhoneSchlageMetadata | null $schlage_metadata, - public PhoneSmartthingsMetadata | null $smartthings_metadata, - public PhoneLocklyMetadata | null $lockly_metadata, - public PhoneNukiMetadata | null $nuki_metadata, - public PhoneKwiksetMetadata | null $kwikset_metadata, - public PhoneSaltoMetadata | null $salto_metadata, - public PhoneGenieMetadata | null $genie_metadata, - public PhoneBrivoMetadata | null $brivo_metadata, - public PhoneIglooMetadata | null $igloo_metadata, - public PhoneNoiseawareMetadata | null $noiseaware_metadata, - public PhoneMinutMetadata | null $minut_metadata, - public PhoneFourSuitesMetadata | null $four_suites_metadata, - public PhoneTwoNMetadata | null $two_n_metadata, - public PhoneControlbywebMetadata | null $controlbyweb_metadata, - public PhoneTtlockMetadata | null $ttlock_metadata, - public PhoneSeamBridgeMetadata | null $seam_bridge_metadata, - public PhoneIgloohomeMetadata | null $igloohome_metadata, - public PhoneNestMetadata | null $nest_metadata, - public PhoneEcobeeMetadata | null $ecobee_metadata, - public PhoneHubitatMetadata | null $hubitat_metadata, - public PhoneDormakabaOracodeMetadata | null $dormakaba_oracode_metadata, - public PhoneWyzeMetadata | null $wyze_metadata, - public array | null $code_constraints, - public array | null $supported_code_lengths, - public float | null $max_active_codes_supported, - public bool | null $supports_backup_access_code_pool, - public bool | null $has_native_entry_events, - public bool | null $locked, - public PhoneKeypadBattery | null $keypad_battery, - public bool | null $door_open, - public float | null $temperature_fahrenheit, - public float | null $temperature_celsius, - public float | null $relative_humidity, - public bool | null $can_enable_automatic_heating, - public bool | null $can_enable_automatic_cooling, - public array | null $available_hvac_mode_settings, - public bool | null $is_heating_available, - public bool | null $is_cooling_available, - public bool | null $is_heating, - public bool | null $is_cooling, - public bool | null $is_fan_running, - public string | null $fan_mode_setting, - public bool | null $is_temporary_manual_override_active, - public PhoneCurrentClimateSetting | null $current_climate_setting, - public PhoneDefaultClimateSetting | null $default_climate_setting, - public bool | null $is_climate_setting_schedule_active, - public PhoneActiveClimateSettingSchedule | null $active_climate_setting_schedule, - public float | null $min_cooling_set_point_celsius, - public float | null $min_cooling_set_point_fahrenheit, - public float | null $max_cooling_set_point_celsius, - public float | null $max_cooling_set_point_fahrenheit, - public float | null $min_heating_set_point_celsius, - public float | null $min_heating_set_point_fahrenheit, - public float | null $max_heating_set_point_celsius, - public float | null $max_heating_set_point_fahrenheit, - public float | null $min_heating_cooling_delta_celsius, - public float | null $min_heating_cooling_delta_fahrenheit, public PhoneAssaAbloyCredentialServiceMetadata | null $assa_abloy_credential_service_metadata, ) { } diff --git a/src/Objects/PhoneSaltoMetadata.php b/src/Objects/PhoneSaltoMetadata.php deleted file mode 100644 index 5ac4509..0000000 --- a/src/Objects/PhoneSaltoMetadata.php +++ /dev/null @@ -1,35 +0,0 @@ -lock_id, - customer_reference: $json->customer_reference, - lock_type: $json->lock_type, - battery_level: $json->battery_level, - locked_state: $json->locked_state, - model: $json->model ?? null, - ); - } - - - - public function __construct( - public string $lock_id, - public string $customer_reference, - public string $lock_type, - public string $battery_level, - public string $locked_state, - public string | null $model, - ) { - } - -} diff --git a/src/Objects/PhoneSchlageMetadata.php b/src/Objects/PhoneSchlageMetadata.php deleted file mode 100644 index b57d275..0000000 --- a/src/Objects/PhoneSchlageMetadata.php +++ /dev/null @@ -1,31 +0,0 @@ -device_id, - device_name: $json->device_name, - access_code_length: $json->access_code_length, - model: $json->model ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public float $access_code_length, - public string | null $model, - ) { - } - -} diff --git a/src/Objects/PhoneSeamBridgeMetadata.php b/src/Objects/PhoneSeamBridgeMetadata.php deleted file mode 100644 index 4063ed1..0000000 --- a/src/Objects/PhoneSeamBridgeMetadata.php +++ /dev/null @@ -1,29 +0,0 @@ -unlock_method ?? null, - device_num: $json->device_num, - name: $json->name, - ); - } - - - - public function __construct( - public string | null $unlock_method, - public float $device_num, - public string $name, - ) { - } - -} diff --git a/src/Objects/PhoneSmartthingsMetadata.php b/src/Objects/PhoneSmartthingsMetadata.php deleted file mode 100644 index 3cacc32..0000000 --- a/src/Objects/PhoneSmartthingsMetadata.php +++ /dev/null @@ -1,31 +0,0 @@ -device_id, - device_name: $json->device_name, - model: $json->model ?? null, - location_id: $json->location_id ?? null, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public string | null $model, - public string | null $location_id, - ) { - } - -} diff --git a/src/Objects/PhoneSound.php b/src/Objects/PhoneSound.php deleted file mode 100644 index d4cb19b..0000000 --- a/src/Objects/PhoneSound.php +++ /dev/null @@ -1,27 +0,0 @@ -time, - value: $json->value, - ); - } - - - - public function __construct( - public string $time, - public float $value, - ) { - } - -} diff --git a/src/Objects/PhoneTemperature.php b/src/Objects/PhoneTemperature.php deleted file mode 100644 index dd64cd3..0000000 --- a/src/Objects/PhoneTemperature.php +++ /dev/null @@ -1,27 +0,0 @@ -time, - value: $json->value, - ); - } - - - - public function __construct( - public string $time, - public float $value, - ) { - } - -} diff --git a/src/Objects/PhoneTtlockMetadata.php b/src/Objects/PhoneTtlockMetadata.php deleted file mode 100644 index 1fa45d8..0000000 --- a/src/Objects/PhoneTtlockMetadata.php +++ /dev/null @@ -1,27 +0,0 @@ -lock_id, - lock_alias: $json->lock_alias, - ); - } - - - - public function __construct( - public float $lock_id, - public string $lock_alias, - ) { - } - -} diff --git a/src/Objects/PhoneTwoNMetadata.php b/src/Objects/PhoneTwoNMetadata.php deleted file mode 100644 index 2003baf..0000000 --- a/src/Objects/PhoneTwoNMetadata.php +++ /dev/null @@ -1,27 +0,0 @@ -device_id, - device_name: $json->device_name, - ); - } - - - - public function __construct( - public float $device_id, - public string $device_name, - ) { - } - -} diff --git a/src/Objects/PhoneWyzeMetadata.php b/src/Objects/PhoneWyzeMetadata.php deleted file mode 100644 index 042e0ed..0000000 --- a/src/Objects/PhoneWyzeMetadata.php +++ /dev/null @@ -1,35 +0,0 @@ -device_id, - device_name: $json->device_name, - product_name: $json->product_name, - product_type: $json->product_type, - product_model: $json->product_model, - device_info_model: $json->device_info_model, - ); - } - - - - public function __construct( - public string $device_id, - public string $device_name, - public string $product_name, - public string $product_type, - public string $product_model, - public string $device_info_model, - ) { - } - -} diff --git a/src/SeamClient.php b/src/SeamClient.php index 54019a3..8326e3b 100644 --- a/src/SeamClient.php +++ b/src/SeamClient.php @@ -98,7 +98,7 @@ public function request( // TODO handle request errors $response = $this->client->request($method, $path, $options); - $statusCode = $response->getStatusCode(); + $status_code = $response->getStatusCode(); $res_json = null; try { @@ -119,9 +119,11 @@ public function request( ); } - if ($statusCode >= 400) { + if ($status_code >= 400) { + $error_message = $response->getReasonPhrase(); + throw new Exception( - "HTTP Error: [" . $statusCode . "] " . $method . " " . $path + "HTTP Error: " . $error_message . " [" . $status_code . "] " . $method . " " . $path ); } @@ -630,7 +632,7 @@ public function poll_until_ready(string $action_attempt_id): ActionAttempt $action_attempt->action_attempt_id ); if ($time_waiting > 20.0) { - throw new Exception("Timed out waiting for access code to be created"); + throw new Exception("Timed out waiting for action attempt to be ready"); } $time_waiting += 0.4; usleep(400000); // sleep for 0.4 seconds @@ -1213,7 +1215,8 @@ public function list( array $device_ids = null, float $limit = null, string $created_before = null, - string $user_identifier_key = null + string $user_identifier_key = null, + mixed $custom_metadata_has = null ): array { $request_payload = []; @@ -1247,6 +1250,9 @@ public function list( if ($user_identifier_key !== null) { $request_payload["user_identifier_key"] = $user_identifier_key; } + if ($custom_metadata_has !== null) { + $request_payload["custom_metadata_has"] = $custom_metadata_has; + } $res = $this->seam->request( "POST", @@ -1436,6 +1442,27 @@ public function __construct(SeamClient $seam) } + public function get_health( + + ): void { + $request_payload = []; + + + + $this->seam->request( + "POST", + "/health/get_health", + json: $request_payload, + + ); + + + + + + + } + public function get_service_health( string $service ): void { @@ -1509,7 +1536,8 @@ public function list( array $device_ids = null, float $limit = null, string $created_before = null, - string $user_identifier_key = null + string $user_identifier_key = null, + mixed $custom_metadata_has = null ): array { $request_payload = []; @@ -1543,6 +1571,9 @@ public function list( if ($user_identifier_key !== null) { $request_payload["user_identifier_key"] = $user_identifier_key; } + if ($custom_metadata_has !== null) { + $request_payload["custom_metadata_has"] = $custom_metadata_has; + } $res = $this->seam->request( "POST", @@ -1882,7 +1913,8 @@ public function list( array $device_ids = null, float $limit = null, string $created_before = null, - string $user_identifier_key = null + string $user_identifier_key = null, + mixed $custom_metadata_has = null ): array { $request_payload = []; @@ -1916,6 +1948,9 @@ public function list( if ($user_identifier_key !== null) { $request_payload["user_identifier_key"] = $user_identifier_key; } + if ($custom_metadata_has !== null) { + $request_payload["custom_metadata_has"] = $custom_metadata_has; + } $res = $this->seam->request( "POST", @@ -2093,6 +2128,29 @@ public function create( + } + + public function delete( + string $user_identity_id + ): void { + $request_payload = []; + + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; + } + + $this->seam->request( + "POST", + "/user_identities/delete", + json: $request_payload, + + ); + + + + + + } public function get( @@ -3313,6 +3371,37 @@ public function list( + } + + public function list_credentials_with_access( + string $acs_entrance_id = null, + array $acs_entrance_ids = null, + array $include_if = null + ): void { + $request_payload = []; + + if ($acs_entrance_id !== null) { + $request_payload["acs_entrance_id"] = $acs_entrance_id; + } + if ($acs_entrance_ids !== null) { + $request_payload["acs_entrance_ids"] = $acs_entrance_ids; + } + if ($include_if !== null) { + $request_payload["include_if"] = $include_if; + } + + $this->seam->request( + "POST", + "/acs/entrances/list_credentials_with_access", + json: $request_payload, + + ); + + + + + + } } @@ -3685,7 +3774,8 @@ public function list( array $device_ids = null, float $limit = null, string $created_before = null, - string $user_identifier_key = null + string $user_identifier_key = null, + mixed $custom_metadata_has = null ): array { $request_payload = []; @@ -3719,6 +3809,9 @@ public function list( if ($user_identifier_key !== null) { $request_payload["user_identifier_key"] = $user_identifier_key; } + if ($custom_metadata_has !== null) { + $request_payload["custom_metadata_has"] = $custom_metadata_has; + } $res = $this->seam->request( "POST", @@ -3817,9 +3910,8 @@ public function create( bool $sync = null, string $name = null, float $noise_threshold_decibels = null, - float $noise_threshold_nrs = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { + float $noise_threshold_nrs = null + ): NoiseThreshold { $request_payload = []; if ($device_id !== null) { @@ -3848,20 +3940,14 @@ public function create( "POST", "/noise_sensors/noise_thresholds/create", json: $request_payload, - inner_object: "action_attempt", + inner_object: "noise_threshold", ); - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - return $action_attempt; + return NoiseThreshold::from_json($res); } public function delete(