google-home / sample-apps-for-matter-android

The Google Home Sample App for Matter (GHSA for Matter) uses the Home Mobile SDK to create an Android app that's similar to Google Home.
Apache License 2.0
110 stars 38 forks source link

Type safety between deviceId and devicePtr #74

Open jonsmirl opened 1 year ago

jonsmirl commented 1 year ago

It would be helpful to have type safety between deviceId and devicePtr since it is very easy to pass in the wrong one

pierredelisle commented 1 year ago

Makes sense. On the TODO list.

tetedoie commented 1 year ago

Internally in GHSAFM, we could use Kotlin value classes

@JvmInline
value class DeviceId(val value: Long)

@JvmInline
value class DevicePointer(val value: Long)