Skip to content

Commit

Permalink
⌛ add option local_delay_update (#1113)
Browse files Browse the repository at this point in the history
  • Loading branch information
HateBaozi authored May 31, 2023
1 parent 8c3a5b7 commit 76a7578
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/xiaomi_miot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1853,6 +1853,7 @@ def set_miot_property(self, siid, piid, value, did=None, **kwargs):
dly = self.custom_config_integer('cloud_delay_update', 6)
else:
results = self.miot_device.send('set_properties', [pms])
dly = self.custom_config_integer('local_delay_update', 1)
ret = MiotResults(results).first
except (DeviceException, MiCloudException) as exc:
self.logger.warning('%s: Set miot property %s failed: %s', self.name_model, pms, exc)
Expand Down Expand Up @@ -1919,6 +1920,7 @@ def miot_action(self, siid, aiid, params=None, did=None, **kwargs):
if not kwargs.get('force_params'):
pms['in'] = action.in_params(params or [])
result = self.miot_device.send('action', pms)
dly = self.custom_config_integer('local_delay_update', 1)
eno = dict(result or {}).get('code', eno)
except (DeviceException, MiCloudException) as exc:
self.logger.warning('%s: Call miot action %s failed: %s', self.name_model, pms, exc)
Expand Down
1 change: 1 addition & 0 deletions custom_components/xiaomi_miot/core/device_customizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@
'number_properties': 'numleds,pixel_per_step,fade_delay,step_delay,stair_travel_time',
},
'qdhkl.aircondition.b23': {
'local_delay_update': 8,
'cloud_delay_update': 8,
'miot_type': 'urn:miot-spec-v2:device:air-conditioner:0000A004:qdhkl-b23:2',
},
Expand Down

0 comments on commit 76a7578

Please sign in to comment.