You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running command raw_command
ERROR:miio.click_common:Exception: {'code': -3, 'error': "Exception <class 'pydantic.v1.error_wrappers.ValidationError'>: 1 validation error for SimulatedMiotProperty\ncurrent_value\n Tried to set read-only property (type=value_error)"}
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/miio/click_common.py", line 54, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/miio/click_common.py", line 305, in wrap
result = kwargs["result"] = func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/click/decorators.py", line 92, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/miio/click_common.py", line 270, in command_callback
return miio_command.call(miio_device, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/miio/click_common.py", line 218, in call
return method(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/miio/click_common.py", line 185, in _wrap
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/miio/device.py", line 141, in raw_command
return self.send(command, parameters)
File "/usr/local/lib/python3.9/site-packages/miio/device.py", line 122, in send
return self._protocol.send(
File "/usr/local/lib/python3.9/site-packages/miio/miioprotocol.py", line 215, in send
self._handle_error(payload["error"])
File "/usr/local/lib/python3.9/site-packages/miio/miioprotocol.py", line 276, in _handle_error
raise DeviceError(error)
miio.exceptions.DeviceError: {'code': -3, 'error': "Exception <class 'pydantic.v1.error_wrappers.ValidationError'>: 1 validation error for SimulatedMiotProperty\ncurrent_value\n Tried to set read-only property (type=value_error)"}
The text was updated successfully, but these errors were encountered:
raiseValueError("Tried to set read-only property")
I can see that being able to set values (also for read-only) is useful, so we could find a solution (e.g., adding an option to allow this, or have a separate method to set read-onlys). What do you think?
I want to test some automated rules, so I need to change some properties of sensors, but they are read-only.
Examples: illumination_sensor
miiocli device --ip 127.0.0.1 --token 00000000000000000000000000000000 raw_command dump_properties '{"siid": 2}'
Running command raw_command
[{'siid': 2, 'piid': 1, 'prop': 'Illumination', 'value': 80073}]
miiocli device --ip 127.0.0.1 --token 00000000000000000000000000000000 raw_command set_properties '[{"siid":2,"piid":1, "value": 1}]'
Running command raw_command
ERROR:miio.click_common:Exception: {'code': -3, 'error': "Exception <class 'pydantic.v1.error_wrappers.ValidationError'>: 1 validation error for SimulatedMiotProperty\ncurrent_value\n Tried to set read-only property (type=value_error)"}
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/miio/click_common.py", line 54, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/miio/click_common.py", line 305, in wrap
result = kwargs["result"] = func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/click/decorators.py", line 92, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/miio/click_common.py", line 270, in command_callback
return miio_command.call(miio_device, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/miio/click_common.py", line 218, in call
return method(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/miio/click_common.py", line 185, in _wrap
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/miio/device.py", line 141, in raw_command
return self.send(command, parameters)
File "/usr/local/lib/python3.9/site-packages/miio/device.py", line 122, in send
return self._protocol.send(
File "/usr/local/lib/python3.9/site-packages/miio/miioprotocol.py", line 215, in send
self._handle_error(payload["error"])
File "/usr/local/lib/python3.9/site-packages/miio/miioprotocol.py", line 276, in _handle_error
raise DeviceError(error)
miio.exceptions.DeviceError: {'code': -3, 'error': "Exception <class 'pydantic.v1.error_wrappers.ValidationError'>: 1 validation error for SimulatedMiotProperty\ncurrent_value\n Tried to set read-only property (type=value_error)"}
The text was updated successfully, but these errors were encountered: