WG4: make the login Application code configurable (fixes empty device list for Danfoss LX / lxwifi.danfoss.us)#687
Merged
robbinjanssen merged 1 commit intoJun 26, 2026
Conversation
The WG4 login body hardcodes "Application": 2, which returns an empty thermostat list for white-labelled clouds that scope devices to a different code. Danfoss LX (host lxwifi.danfoss.us) uses code 4: sweeping 0-8 against /api/thermostats for a real LX205T account, only 4/5/6 return the device while 2 returns nothing. Add an optional application: int = 2 parameter to WG4API and use it in login_body(). Default is unchanged, so existing mythermostat.info users are unaffected; Danfoss LX users can pass application=4. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
robbinjanssen
approved these changes
Jun 25, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #687 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 521 522 +1
Branches 67 67
=========================================
+ Hits 521 522 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Owner
|
Published as v3.5.0 🎉 If you create a new pull request for the home-assistant integration, i'll release it asap :-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an optional
application: int = 2parameter toWG4API, used inlogin_body()instead of the hardcoded2. The default is unchanged.Why
A WG4 setup pointed at the Danfoss LX white-label cloud (
host="lxwifi.danfoss.us") authenticates fine butget_thermostats()returns groups with emptyThermostats[]— no devices are found — even though the thermostat is online and fully controllable in the Danfoss app.Root cause: the WG4 login hardcodes
"Application": 2. Danfoss LX devices are scoped to a different application code. Sweeping codes 0–8 against/api/thermostatsfor a real Danfoss LX205T account:Online: true)So with
Application: 2the list comes back empty; withApplication: 4the device appears.Change
WG4API(username=..., password=..., host="lxwifi.danfoss.us", application=4)now sends the correct code. Existingmythermostat.infousers are unaffected (default stays2).Tests
Added
test_login_body_default_applicationandtest_login_body_custom_application.tests/test_wg4.pypasses (9 passed) locally.Related
Pairs with the integration-side request in robbinjanssen/home-assistant-ojmicroline-thermostat#441.
Follow-up
The Home Assistant integration (
home-assistant-ojmicroline-thermostat) also needs a small change — exposing this as an optional config field on the WG4 step — to make it usable end-to-end. That integration PR will close #441 once this lands; happy to open it then.