Codename One Adds Unified Java API for HomeKit, Matter, and Google Home

Open-source framework Codename One has introduced a new package, com.codename1.home, via pull request #5554, providing a single Java API to interact with smart home platforms including HomeKit, Matter, and Google Home. The API allows developers to list accessories, read and write traits, monitor changes, run scenes, and commission Matter devices without handling platform-specific identifiers or value conversion rules. It standardises traits such as ON_OFF, BRIGHTNESS, and TARGET_TEMPERATURE while managing backend differences — for example, Matter's 0–254 brightness scale or reversed covering-position logic on certain platforms. The SmartHome.getInstance() method always returns a non-null object, with unsupported platforms returning a NOT_SUPPORTED fallback to avoid confusion between an unconfigured home and one with no devices. Full Google Home accessory graph support is not included in this release, as it requires additional Google Cloud credentials that the framework cannot provision on behalf of developers.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in