Skip to content

Conversation

@folfy
Copy link
Contributor

@folfy folfy commented Nov 2, 2025

This is deduplicating the temperature functions, and then finally dropping the int(...) cast on the "integer" temperature value. This is used on e.g. the Midea PortaSplit, which reports half-degree values via this field (decimal value = 0).

I'd think if a device reports a decimal value as int + decimal, then it won't report half-degree steps for the integer, and the casting of the integer would be redundant. To be on the safe side though, and avoid potential regressions, I've implemented it to only return the integer as float, if the decimal really is 0. So even if the integer is reported with half-degree steps and a seperate decimal simultaneously, it'd be fine, since in that case the integer should be a whole number anyway.

PS: Let me know if and what you'd want as "proof", e.g. HA or Midea-App screenshots, debug logs (before or after fix), etc., and I'll provide it (just don't want to waste time on unnecessary stuff)

@folfy
Copy link
Contributor Author

folfy commented Nov 3, 2025

Fixed ruff and mypy issues (https://github.com/midea-lan/midea-local/actions/runs/19017035037/job/54319895649?pr=412)

Changes (merged commit via force-push): b07cdbe

@wuwentao wuwentao added this to the v6.6.0 milestone Nov 4, 2025
@wuwentao
Copy link
Member

wuwentao commented Nov 4, 2025

thank you very much for your PR.
merged!

@wuwentao wuwentao merged commit 95ba499 into midea-lan:main Nov 4, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants