Repository navigation
Register directly, and drop the bridge type - #170
Merged
Merged
Conversation
register() started a session first on a LAN C, to find out whether the app was registered already, and registered directly on a ComfoConnect Pro, which doesn't answer that session. A LAN C accepts an app that is registered already too, as long as the PIN is right, and the official app also registers directly. So register directly on every bridge; the bridge type no longer matters for registering. Breaking change: register() no longer returns whether the app was newly registered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since registering no longer depends on it, nothing in the library uses the bridge type anymore. The node of the bridge tells the same with its product id: 222 for a ComfoConnect Pro, 5 for a LAN C, 9 for the WiFi module of a ComfoAir Flex. So drop bridge_type, the bridge_type argument of Bridge and ComfoConnect, GatewayType, and recognising a Pro by the "ccpro" of the session. Breaking change: Bridge() and ComfoConnect() no longer take bridge_type, and GatewayType is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
michaelarnauts
force-pushed
the
register-directly
branch
from
October 20, 2026 11:19
339ca82 to
1e0aee3
Compare
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.
Summary
register()started a session first on a LAN C, to find out whether the app was registered already, and registered directly on a ComfoConnect Pro, since a Pro doesn't answer a session of an app that isn't registered (it times out). That made the bridge type necessary for registering, so Home Assistant had to discover a bridge before a reauth.A LAN C accepts registering an app that is registered already, as long as the PIN is right, without adding another entry (it keeps the first name); a wrong PIN is refused with
NOT_ALLOWED, also for a registered app. A Pro was already always registered directly, also on a reauth of an app that was still registered. This is now indocs/PROTOCOL.mdtoo. The official app also registers directly: it creates a new UUID and sendsRegisterAppRequestwithout starting a session first, with PIN 0 and then the PIN the user enters. It only learns that a bridge is a Pro from the session confirmation ("ccpro").So
register()now registers directly on every bridge and then starts a session.With that, nothing in the library uses the bridge type anymore, so it goes:
bridge_type, thebridge_typeargument ofBridge()andComfoConnect(),GatewayType, and recognising a Pro by the"ccpro"of the session confirmation. The node of the bridge tells the same with its product id (222 a ComfoConnect Pro, 5 a LAN C, 9 the WiFi module of a ComfoAir Flex, see #169). The official app uses "is a Pro" for a few features we don't have (UK time, zones through whoami); the product id of the bridge node can tell that if we ever need it.docs/PROTOCOL.mdstill describes"ccpro".Breaking changes:
Bridge()andComfoConnect()no longer takebridge_type, thebridge_typeattribute andGatewayTypeare gone, and discovery no longer reports the type.register()no longer returns whether the app was newly registered; we can't tell anymore. The CLI prints "UUID … is registered." Registering a UUID that is registered already now needs the right PIN:registerfor it without--pinon a bridge with another PIN than 0 used to say "already registered", and now fails with "check the PIN". Home Assistant only registers a new UUID, or one the bridge no longer accepts, so it isn't affected.Testing
test_registers_then_starts_session(LAN C, the WiFi module of a Flex, Pro) andtest_wrong_pin.NOT_ALLOWED; registering, registering again, and starting a session succeed; registering again with a wrong PIN givesNOT_ALLOWED.registerfrom the CLI twice in a row succeeds both times.🤖 Generated with Claude Code