diff --git a/src/Objects/Event.php b/src/Objects/Event.php index 9cf798c..e2f4ff3 100644 --- a/src/Objects/Event.php +++ b/src/Objects/Event.php @@ -10,23 +10,29 @@ public static function from_json(mixed $json): Event|null return null; } return new self( - created_at: $json->created_at, - event_description: $json->event_description, - event_id: $json->event_id, - event_type: $json->event_type, - occurred_at: $json->occurred_at, - workspace_id: $json->workspace_id, + access_code_id: $json->access_code_id ?? null, acs_credential_id: $json->acs_credential_id ?? null, + acs_encoder_id: $json->acs_encoder_id ?? null, acs_system_id: $json->acs_system_id ?? null, acs_user_id: $json->acs_user_id ?? null, action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + backup_access_code_id: $json->backup_access_code_id ?? null, + battery_level: $json->battery_level ?? null, + battery_status: $json->battery_status ?? null, client_session_id: $json->client_session_id ?? null, climate_preset_key: $json->climate_preset_key ?? null, + connect_webview_id: $json->connect_webview_id ?? null, + connected_account_id: $json->connected_account_id ?? null, cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, + created_at: $json->created_at ?? null, device_id: $json->device_id ?? null, enrollment_automation_id: $json->enrollment_automation_id ?? null, + error_code: $json->error_code ?? null, + event_id: $json->event_id ?? null, + event_type: $json->event_type ?? null, fan_mode_setting: $json->fan_mode_setting ?? null, heating_set_point_celsius: $json->heating_set_point_celsius ?? null, heating_set_point_fahrenheit: $json->heating_set_point_fahrenheit ?? @@ -35,34 +41,72 @@ public static function from_json(mixed $json): Event|null is_fallback_climate_preset: $json->is_fallback_climate_preset ?? null, method: $json->method ?? null, - thermostat_schedule_id: $json->thermostat_schedule_id ?? null + minut_metadata: $json->minut_metadata ?? null, + noise_level_decibels: $json->noise_level_decibels ?? null, + noise_level_nrs: $json->noise_level_nrs ?? null, + noise_threshold_id: $json->noise_threshold_id ?? null, + noise_threshold_name: $json->noise_threshold_name ?? null, + noiseaware_metadata: $json->noiseaware_metadata ?? null, + occurred_at: $json->occurred_at ?? null, + status: $json->status ?? null, + temperature_celsius: $json->temperature_celsius ?? null, + temperature_fahrenheit: $json->temperature_fahrenheit ?? null, + workspace_id: $json->workspace_id ?? null, + code: $json->code ?? null, + lower_limit_celsius: $json->lower_limit_celsius ?? null, + lower_limit_fahrenheit: $json->lower_limit_fahrenheit ?? null, + thermostat_schedule_id: $json->thermostat_schedule_id ?? null, + upper_limit_celsius: $json->upper_limit_celsius ?? null, + upper_limit_fahrenheit: $json->upper_limit_fahrenheit ?? null ); } public function __construct( - public string $created_at, - public string $event_description, - public string $event_id, - public string $event_type, - public string $occurred_at, - public string $workspace_id, + public string|null $access_code_id, public string|null $acs_credential_id, + public string|null $acs_encoder_id, public string|null $acs_system_id, public string|null $acs_user_id, public string|null $action_attempt_id, + public string|null $action_type, + public string|null $backup_access_code_id, + public float|null $battery_level, + public string|null $battery_status, public string|null $client_session_id, public string|null $climate_preset_key, + public string|null $connect_webview_id, + public string|null $connected_account_id, public float|null $cooling_set_point_celsius, public float|null $cooling_set_point_fahrenheit, + public string|null $created_at, public string|null $device_id, public string|null $enrollment_automation_id, + public string|null $error_code, + public string|null $event_id, + public string|null $event_type, public string|null $fan_mode_setting, public float|null $heating_set_point_celsius, public float|null $heating_set_point_fahrenheit, public string|null $hvac_mode_setting, public bool|null $is_fallback_climate_preset, public string|null $method, - public string|null $thermostat_schedule_id + public mixed $minut_metadata, + public float|null $noise_level_decibels, + public float|null $noise_level_nrs, + public string|null $noise_threshold_id, + public string|null $noise_threshold_name, + public mixed $noiseaware_metadata, + public string|null $occurred_at, + public string|null $status, + public float|null $temperature_celsius, + public float|null $temperature_fahrenheit, + public string|null $workspace_id, + public string|null $code, + public float|null $lower_limit_celsius, + public float|null $lower_limit_fahrenheit, + public string|null $thermostat_schedule_id, + public float|null $upper_limit_celsius, + public float|null $upper_limit_fahrenheit ) { } } diff --git a/src/SeamClient.php b/src/SeamClient.php index c67ee79..9656b50 100644 --- a/src/SeamClient.php +++ b/src/SeamClient.php @@ -1482,7 +1482,6 @@ public function list( public function scan_credential( string $acs_encoder_id, - string $acs_system_id, bool $wait_for_action_attempt = true ): ActionAttempt { $request_payload = []; @@ -1490,9 +1489,6 @@ public function scan_credential( if ($acs_encoder_id !== null) { $request_payload["acs_encoder_id"] = $acs_encoder_id; } - if ($acs_system_id !== null) { - $request_payload["acs_system_id"] = $acs_system_id; - } $res = $this->seam->request( "POST", @@ -1703,11 +1699,11 @@ public function add_to_access_group( public function create( string $acs_system_id, + string $full_name, mixed $access_schedule = null, array $acs_access_group_ids = null, string $email = null, string $email_address = null, - string $full_name = null, string $phone_number = null, string $user_identity_id = null ): AcsUser { @@ -1716,6 +1712,9 @@ public function create( if ($acs_system_id !== null) { $request_payload["acs_system_id"] = $acs_system_id; } + if ($full_name !== null) { + $request_payload["full_name"] = $full_name; + } if ($access_schedule !== null) { $request_payload["access_schedule"] = $access_schedule; } @@ -1728,9 +1727,6 @@ public function create( if ($email_address !== null) { $request_payload["email_address"] = $email_address; } - if ($full_name !== null) { - $request_payload["full_name"] = $full_name; - } if ($phone_number !== null) { $request_payload["phone_number"] = $phone_number; }