Skip to content

Add option to set HA as launcher #5348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fpetrovski
Copy link
Contributor

Summary

This PR is related to #5023 where it was discussed to allow HA Companion app to become a launcher.
A new option was added to the preference settings, under "Other Settings" Preference Category.

Checklist

  • New or updated tests have been added to cover the changes following the testing guidelines.
  • The code follows the project's code style and best_practices.
  • The changes have been thoroughly tested, and edge cases have been considered.
  • Changes are backward compatible whenever feasible. Any breaking changes are documented in the changelog for users and/or in the code for developers depending on the relevance.

Screenshots

Any other notes

@dshokouhi dshokouhi linked an issue May 22, 2025 that may be closed by this pull request
Copy link
Member

@jpelgrom jpelgrom left a comment

Choose a reason for hiding this comment

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

I'm personally still not convinced this feature needs to be added to the companion app.

@@ -37,6 +37,11 @@
</PreferenceCategory>
<PreferenceCategory
android:title="@string/other_settings">
<Preference
Copy link
Member

Choose a reason for hiding this comment

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

Does this need this amount of promotion (in settings! the first item!) for a feature 99% of users will not use?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to position it there since it's somewhat related to fullscreen, screen orientation and keep screen on, in the sense that it changes how the device behaves.
I can move it below those 3.

Copy link
Member

Choose a reason for hiding this comment

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

Although this largely compliments most of the apps WebView features this feels like a big behavior change for a device that not every user will want to enable on every device. Maybe a new category is a good idea for this so we can also describe why a user may want to set the app as the launcher? They may not understand that they will need to do things like updating the dashboard to add links to apps etc...

One of the reasons why its not good to list it at the top is that users may enable it on accident and that may not lead to a good experience.

Copy link
Member

Choose a reason for hiding this comment

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

Another thought: make the launcher an activity-alias that can be enabled/disabled and require the user to opt-in to the setting to choose HA as a launcher (= enable the activity alias). We should avoid the possibility that users accidentally set HA as a launcher.

Copy link
Contributor Author

@fpetrovski fpetrovski May 24, 2025

Choose a reason for hiding this comment

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

make the launcher an activity-alias that can be enabled/disabled

@jpelgrom I can create a new SwitchPreference for this.

Maybe a new category is a good idea for this

@dshokouhi, would it be acceptable if I add the switch and based on the state show or hide the current Preference item that navigates to the settings? The new category could be simply named "Launcher" or "Kiosk", although for it to be truly a kiosk app, a few other things need to be implemented.

Another option is to open a new page like "Manage Sensors" or "Notification History", but I'm not sure if it makes sense to have an entire page just for one option. Additionally if the app is being slowly converted to JetpackCompose, adding another fragment does not help :)

Copy link
Member

Choose a reason for hiding this comment

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

@dshokouhi, would it be acceptable if I add the switch and based on the state show or hide the current Preference item that navigates to the settings?

Yup sounds good with me, I like @jpelgrom suggestion to make it explicit opt-in

The new category could be simply named "Launcher" or "Kiosk", although for it to be truly a kiosk app, a few other things need to be implemented.

Could be a good start to a set of new features ;) We can maybe leave it as generic and update it if anything else gets added to compliment it.

Another option is to open a new page like "Manage Sensors" or "Notification History", but I'm not sure if it makes sense to have an entire page just for one option. Additionally if the app is being slowly converted to JetpackCompose, adding another fragment does not help :)

That is an option and in fact some of the sub settings pages have already been converted to Compose so we can interchange them. For now with just 1 option it may not make sense. However a dedicated page is a good place for an extended description if required.

@@ -58,6 +58,8 @@ import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import timber.log.Timber

private const val UNKNOWN_LAUNCHER_LABEL = "unknown app"
Copy link
Member

Choose a reason for hiding this comment

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

Should be translated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Absolutely, thanks for pointing it out.

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

Successfully merging this pull request may close these issues.

Allow the app to be the launcher
3 participants