Skip to content

feat: centralize hayward command building#5

Merged
matchews merged 1 commit into
haywardomnilogiclocalfrom
codex/create-commandbuilder-and-refactor-handlers
Sep 9, 2025
Merged

feat: centralize hayward command building#5
matchews merged 1 commit into
haywardomnilogiclocalfrom
codex/create-commandbuilder-and-refactor-handlers

Conversation

@matchews

@matchews matchews commented Sep 9, 2025

Copy link
Copy Markdown
Owner

Summary

  • add CommandBuilder utility to assemble Hayward XML requests
  • use CommandBuilder in virtual heater handlers

Testing

  • mvn -q -pl bundles/org.openhab.binding.haywardomnilogiclocal,bundles/org.openhab.binding.haywardomnilogic -am test (fails: Non-resolvable parent POM org.openhab:openhab-super-pom)

https://chatgpt.com/codex/tasks/task_e_68c04a5197dc832380c432d974f8faa4

@matchews matchews merged commit 377284c into haywardomnilogiclocal Sep 9, 2025
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +37 to +46
public static String buildSetHeaterEnable(String prefix, String token, int mspSystemID, String poolID,
String heaterID, String enabled) {
return prefix
+ String.format(SET_HEATER_ENABLE, token, mspSystemID, poolID, heaterID, enabled)
+ closingTag(prefix);
}

public static String buildSetUIHeaterCmd(String prefix, String token, int mspSystemID, String poolID,
String heaterID, String temp) {
return prefix + String.format(SET_UI_HEATER_CMD, token, mspSystemID, poolID, heaterID, temp)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P0] Align mspSystemID parameter type with callers

The new CommandBuilder expects int mspSystemID in both buildSetHeaterEnable and buildSetUIHeaterCmd, but HaywardAccount.mspSystemID is defined as a String and the handlers pass that string directly. This mismatch means the binding no longer compiles because there is no implicit conversion from String to int. Either accept a String here or parse it at the call site before invoking the builder.

Useful? React with 👍 / 👎.

Comment on lines +37 to +46
public static String buildSetHeaterEnable(String prefix, String token, int mspSystemID, String poolID,
String heaterID, String enabled) {
return prefix
+ String.format(SET_HEATER_ENABLE, token, mspSystemID, poolID, heaterID, enabled)
+ closingTag(prefix);
}

public static String buildSetUIHeaterCmd(String prefix, String token, int mspSystemID, String poolID,
String heaterID, String temp) {
return prefix + String.format(SET_UI_HEATER_CMD, token, mspSystemID, poolID, heaterID, temp)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P0] Use String for mspSystemID in local command builder

The local variant of CommandBuilder repeats the same int mspSystemID signature even though HaywardAccount.mspSystemID is a String. Calls from HaywardVirtualHeaterHandler now fail to compile because a String cannot be passed to these methods. The parameter should be a string (or callers should parse it to an integer) so the module builds.

Useful? React with 👍 / 👎.

@matchews matchews deleted the codex/create-commandbuilder-and-refactor-handlers branch September 10, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant