-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDeviceCurrentClimateSetting.php
More file actions
54 lines (51 loc) · 2.18 KB
/
Copy pathDeviceCurrentClimateSetting.php
File metadata and controls
54 lines (51 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
namespace Seam\Objects;
class DeviceCurrentClimateSetting
{
public static function from_json(
mixed $json,
): DeviceCurrentClimateSetting|null {
if (!$json) {
return null;
}
return new self(
can_delete: $json->can_delete ?? null,
can_edit: $json->can_edit ?? null,
can_use_with_thermostat_daily_programs: $json->can_use_with_thermostat_daily_programs ??
null,
climate_preset_key: $json->climate_preset_key ?? null,
climate_preset_mode: $json->climate_preset_mode ?? null,
cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null,
cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ??
null,
display_name: $json->display_name ?? null,
ecobee_metadata: isset($json->ecobee_metadata)
? DeviceEcobeeMetadata::from_json($json->ecobee_metadata)
: 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 ??
null,
hvac_mode_setting: $json->hvac_mode_setting ?? null,
manual_override_allowed: $json->manual_override_allowed ?? null,
name: $json->name ?? null,
);
}
public function __construct(
public bool|null $can_delete,
public bool|null $can_edit,
public bool|null $can_use_with_thermostat_daily_programs,
public string|null $climate_preset_key,
public string|null $climate_preset_mode,
public float|null $cooling_set_point_celsius,
public float|null $cooling_set_point_fahrenheit,
public string|null $display_name,
public DeviceEcobeeMetadata|null $ecobee_metadata,
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 $manual_override_allowed,
public string|null $name,
) {}
}