Commit graph

24 commits

Author SHA1 Message Date
Justin Bassett 1f48c44f44
Clean up a bunch of warnings. (#1053)
* Clean up a bunch of warnings.

* Remove unused class.
2020-10-15 08:16:34 -04:00
Patrick Decat cce1608bf0
Allow overriding PUSH_URL and RATE_LIMIT_URL in gradle.properties (#1032)
* Extract PUSH_URL and RATE_LIMIT_URL as BuildConfig values that can be overriden in local.properties

* Put push and rate limit URLs in gradle.properties instead of local.properties which can be overwritten by Android Studio
2020-10-11 14:14:49 -04:00
Justin Bassett 57358433f3
Initial Support for Android 11 Power Menu Actions (#1027)
* Upgrade target api.

* Proof of concept for Android 11 power menu controls.

* Support toggle types.

* More sustainable way to expand.

* Add input_number support.

* Add crappy fan support.

* Add Light support!

* Code Cleanup.
2020-10-11 00:37:40 -04:00
Daniel Shokouhi 08456d2a1b
Add notification rate limit info to settings (#1015)
* Add notification rate limit to settings

* Clean up

* Allow the preference to be copied

* Move logic to integrationService, make summary look better

* Review comments

* Clean up

* Lint
2020-10-08 14:05:13 -04:00
Jay Newstrom ec5295a546
Only add the logging interceptor for debug builds. (#970)
Closes #915
2020-09-22 22:01:55 -04:00
Justin Bassett 6e13b16214
Architecture Simplification (#917)
* Common compiling....
So I guess I have that going for me...

* It's very broken...

* App builds and tests pass....

* Remove other now extra files.
2020-09-11 15:39:30 -04:00
chriss158 631b9d1cf5
Add themes selector (#780)
* Add themes selector

* Fix lint

* Fix test

* Remove german translation

* Default theme "system" on >= Pie

* Use useSimpleSummaryProvider for themes preference

* Fix lint

* Fix dark mode wait color text in "unable to connect to home assistant" message

* Fix tint of widget button icon in light mode

* Implement ThemeManager to handle theming

* Fix lint

* Fix WebViewPresenterImplSpec test
2020-08-21 09:04:11 -04:00
Justin Bassett 4c91c34ec8
Let widgets use any material icon (#745)
* Functional widgets with all material icons to pick from.

* Load icons in io thread since it takes a hot second.

* Bump DB version.

* ktlint

* Blow away widget prefs since it was a hack anyway.

* Migrate static widgets to room db.

* ktlint and tests.

* Little more cleanup.

* More ktlint.

* Initial attempt at Migrations.

* Add missing Migrations.kt

* Add full migration support from old to new widgets.
2020-08-16 22:18:20 -04:00
Neonicus 756556046a
Fix Biometric Unlock & Enhancement (#625)
* Fix Biometric Unlock
* Add Prompt Unlock function directly in WebViewActivity
* Added session timeout in app settings
* App is locked when resumed (after session timed out)
* When the application is locked, the screen is blurred (no quite obnoxious splash screen to look at), which allows the HA frontend to be loaded before or during unlocking
* No button needs to be touched for unlock
* When the unlock prompt is displayed, the back button close the app
* Fix issues #555 and #587
2020-07-05 10:09:17 -04:00
Justin Bassett 247cef3c72
Fix lint issues (#618)
* Increase tool version, enable linting again.

* Fix lint errors.

* Ensure ktlint is working.

* Use correct build tools in travis.
2020-06-11 13:15:50 -04:00
Tim f87ed32560
Feature/switch to kotlin dsl (#595)
* Switch to using Kotlin in of groovy for the gradle configurations.

* Gradle file cleanup.

* Switch to using Kotlin in of groovy for the gradle configurations.

* Gradle file cleanup.

* Retrofit (and maybe others libs) requires java compile options 1.8, still backwards compatible.

* Prep for release 1.9.0-XXX

* Fix ktLint errors.
2020-06-10 15:16:11 -04:00
Justin Bassett 5f1c72586b
Support for multiple ssids. (#485)
* Support for multiple ssids.

* Implementation of requested changes.

* Implementation of the official way of showing a custom preference dialog.
2020-03-04 13:16:13 -05:00
Kevin T. Berstene 2283042393
Added dynamic auto-complete fields for widget configuration (#339) 2020-02-07 20:47:26 -05:00
Kevin T. Berstene 9f5a61b0ce Basic widget functionality added (#212)
* Basic widget functionality added

* Requested Fixes: 4 of 6 completed

* Changed widget to be responsive and have a light icon instead of a generic Home Assistant icon

* Fixed issue with latest rebase from upstream master

* Restricted label text to a single line

* Created repository and use case for widget data storage

* Fixed indentation

* Fix for Oreo and later Broadcast Intent restrictions

* Added negative feedback for widget.  Wrapped try blockaround only the relevant commands.

* Removed defunct preferences utilities file

* Removed unnecessary try catch block

* Fixed issue where layout would reset upon screen rotation after activating the widget.

* Moved widget storage logic to repository as requested

* Added multiple widget icons with a drop down menu in the configuration activity.
Added labels to configuration activity.
Made configuration activity scrollable.

* Changed widget feedback to be more immediate and clear.  Changed color of positive feedback.

* Changed callService HashMap to match Integration Repository

* Added testing for Integration callService method

* Changed how icons are stored so regeneration of resources will not randomize the stored icons

* Added basic WidgetUseCaseImpl tests

* Privatized localStorage access in WidgetRepositorImpl, removing it from the WidgetRepository interface
2020-01-22 14:55:51 -08:00
Justin Bassett 195bc9601c Reload UI url more proactively (#275)
* Reload UI if the base url has changed.
AKA changed from remote/local.

* Linting.

* Now we don't rebuild dagger every time we change urls.
Need to fix tests.

* Test and comment.
2020-01-19 13:51:10 -08:00
Justin Bassett cf283cf662 Fix migration to pull from the correct preference. (#246) 2020-01-10 19:52:02 +01:00
Justin Bassett 5f54896057 Support Migrations (#224)
* Add instanceId to data layer.

* Support migrations.

* Formatting

* Make sure version is set.

* Validate migrations working.
2020-01-08 22:51:57 +01:00
Justin Bassett 5d02ec9bc6
Send device_id for HA versions above 0.104.0 (#234) 2020-01-08 15:49:38 -05:00
Justin Bassett ffdc3c3750 Home Network Settings (#209)
* Url management now abstracted to new separate use case.

* Add preferences for URLS.

* Add wifi ssid check.

* Tests now passing!

* Now show error and bring to settings when can't connect.

* Fix PR comments.

* Home SSID tracking now working.
Also go to settings if refresh token fails.

* Fix test.

* isInternal is now optional, we can determine in the repository if needed.

* Rework preferences ordering and disable when not used.

* Extract strings.

* Add validation of URLs.

* Formatting.

* Fix tests.
2020-01-03 11:43:25 +01:00
Justin Bassett 715ca9e362 Allow editing of Device Name (#158)
* Migrate preference categories to string resource.
Disable lint for missing translations.

* We now can change the device name.

* Linting Fixes.

* Tests a functional, now to add new tests.

* Fix all the tests for real this time.
Fix clean task being in wrong group.

* Add tests for persisting device registration.

* Extract string, remove summary, use androidx preferences.

* Migrate to injection and constants for registration data that is build time.

* Use SimpleSummaryProvider.

* Revert global missing translation lint error.

* Disable MissingTranslation lint globally.
2019-12-19 16:40:26 +01:00
Justin Bassett 594936c088 Feature/location settings (#129)
* Initial work on zone based location tracking.

* Tests and enhancements.

* Fix unit tests.

* Fix test cases.

* Initial location preferences work.

* Location settings now function will requests for permissions when needed.

* ktlink formatting.

* Domain tests.

* Data tests

* Extract strings into resources.

* Remove translations until Lokalise SDK is added back.
Failing lint

* Update wording.

* Add icons and toolbar.

* Coloring the settings.
2019-12-11 14:02:31 -06:00
Marcio Granzotto Rodrigues 7d7fc0bd6e Code formatting and linter (#73)
* add ktlint to the project

* Auto format and fix linter issues

* Add Quality section to README
2019-12-01 09:05:37 +01:00
Justin Bassett ea56328a52 Initial work on integrating the mobile_app component. (#25)
* Initial work on integrating the mobile_app component.

* Tests because even if I don't like to write them, I probably should.

* Remove unused dependency for now.

* Fix view related PR comments, migrate to view flipper to make more
consistent with other UI.

* Migrate from error handling at Repository to Presenter for Integration.

* Extract register device data class.

* Extract the mapping of DeviceRegistration to RegisterDeviceRequest.

* Extract ensuring we have a valid, refreshed session.

* Unique localStorage per usage to avoid name collision.
2019-11-15 07:59:41 +01:00
Cedrick Flocon 3219504a12 [ARCHITECTURE] Let's do some quality (#15)
* extract dependencies

* Update test command and add lint

* Move Retrofit into data module and test authentication service

* Implement authorization repository

* Implementation authentication usecase

* Implementation presenter layer

* Remove old session stuff

* Java time backport

* Dependency with dagger
2019-11-10 13:07:38 -08:00