We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug The test_set_property_by[value_type4-1] broke on Python 3.13, but works on 3.12.
test_set_property_by[value_type4-1]
Visible in the CI: https://github.com/rytilahti/python-miio/actions/runs/11759608046/job/32759267643
Version information (please complete the following information):
To Reproduce Steps to reproduce the behavior:
Expected behavior Home Assistant requires Python 3.13 by Feb 2025, so I hope that the python-miio test suite works with 3.13.
Console output
_____________________ test_set_property_by[value_type4-1] ______________________ dev = <MiotDevice: 127.0.0.1 (token: 68ffffffffffffffffffffffffffffff)> value_type = functools.partial(<function MiotValueType._str2bool at 0x7ffff54b9ee0>) value = '1' @pytest.mark.parametrize( "value_type,value", [ (None, 1), (MiotValueType.Int, "1"), (MiotValueType.Float, "1.2"), (MiotValueType.Str, "str"), (MiotValueType.Bool, "1"), ], ) def test_set_property_by(dev, value_type, value): siid = 1 piid = 1 > _ = dev.set_property_by(siid, piid, value, value_type) miio/tests/test_miotdevice.py:61: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ miio/click_common.py:184: in _wrap return func(self, *args, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <MiotDevice: 127.0.0.1 (token: 68ffffffffffffffffffffffffffffff)> siid = 1, piid = 1, value = '1' value_type = functools.partial(<function MiotValueType._str2bool at 0x7ffff54b9ee0>) @command( click.argument("siid", type=int), click.argument("piid", type=int), click.argument("value"), click.argument( "value_type", type=EnumType(MiotValueType), required=False, default=None ), ) def set_property_by( self, siid: int, piid: int, value: Union[int, float, str, bool], value_type: Any = None, ): """Set a single property (siid/piid) to given value. value_type can be given to convert the value to wanted type, allowed types are: int, float, bool, str """ if value_type is not None: > value = value_type.value(value) E AttributeError: 'functools.partial' object has no attribute 'value' miio/miot_device.py:142: AttributeError
The text was updated successfully, but these errors were encountered:
I think #1993 fixes this, but it hasn't been tested so far.
Sorry, something went wrong.
Thanks, that looks perfect!
Successfully merging a pull request may close this issue.
Describe the bug
The
test_set_property_by[value_type4-1]
broke on Python 3.13, but works on 3.12.Visible in the CI: https://github.com/rytilahti/python-miio/actions/runs/11759608046/job/32759267643
Version information (please complete the following information):
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Home Assistant requires Python 3.13 by Feb 2025, so I hope that the python-miio test suite works with 3.13.
Console output
The text was updated successfully, but these errors were encountered: