Skip to content

WG4: make the login Application code configurable (fixes empty device list for Danfoss LX / lxwifi.danfoss.us)#687

Merged
robbinjanssen merged 1 commit into
robbinjanssen:mainfrom
Bannicq:feat/wg4-configurable-application
Jun 26, 2026
Merged

WG4: make the login Application code configurable (fixes empty device list for Danfoss LX / lxwifi.danfoss.us)#687
robbinjanssen merged 1 commit into
robbinjanssen:mainfrom
Bannicq:feat/wg4-configurable-application

Conversation

@Bannicq

@Bannicq Bannicq commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What

Adds an optional application: int = 2 parameter to WG4API, used in login_body() instead of the hardcoded 2. The default is unchanged.

Why

A WG4 setup pointed at the Danfoss LX white-label cloud (host="lxwifi.danfoss.us") authenticates fine but get_thermostats() returns groups with empty Thermostats[] — 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/thermostats for a real Danfoss LX205T account:

Application code thermostats returned
0, 1, 2, 3, 7, 8 0
4, 5, 6 1 (the device, Online: true)

So with Application: 2 the list comes back empty; with Application: 4 the device appears.

Change

WG4API(username=..., password=..., host="lxwifi.danfoss.us", application=4) now sends the correct code. Existing mythermostat.info users are unaffected (default stays 2).

Tests

Added test_login_body_default_application and test_login_body_custom_application. tests/test_wg4.py passes (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.

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 robbinjanssen added the new-feature New features or options. label Jun 25, 2026
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5d7980d) to head (d1701a2).
⚠️ Report is 10 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@robbinjanssen robbinjanssen merged commit ca74ee6 into robbinjanssen:main Jun 26, 2026
15 of 16 checks passed
@robbinjanssen

Copy link
Copy Markdown
Owner

Published as v3.5.0 🎉

If you create a new pull request for the home-assistant integration, i'll release it asap :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature New features or options.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants