Commit Graph

20 Commits

Author SHA1 Message Date
Bruno Pantaleão Gonçalves
43e12d039c Reintroduce reorder servers (#3970)
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2025-11-13 10:48:39 +01:00
mat1th
97834bfd5e Update swift lint and format + appy fixes (#2585)
## Summary
Swift lint and swiftformat are outdated. This PR does update those +
applies the new formatting form swiftformat.
There is 1 swift file with a manual change:
`Sources/Vehicle/Templates/Areas/CarPlayAreasViewModel.swift`. This is
done because `swiftlint` did create the following swiftlint error:
`error: Cyclomatic Complexity Violation: Function should have complexity
10 or less; currently complexity is 11 (cyclomatic_complexity)`.

Because it does change a lot of files the question is if we want to
finetune the `swiftformat` rules.

## Screenshots
No user facing changes.

## Link to pull request in Documentation repository
NA

## Any other notes
NA
2024-02-22 13:06:39 +01:00
Zac West
ab56fd7afa Revert "Remove Firebase (#2028)" (#2051)
This reverts commit 2c4bab1d5c.
2022-01-23 18:45:04 +00:00
Zac West
2c4bab1d5c Remove Firebase (#2028)
## Summary
Removes FCM and related SDKs in favor of using the server introduced in #2024.

## Any other notes
This will require testing. It may be worth reverting this PR to introduce a toggle if this lasts more than 1 beta cycle.

Future work includes figuring out the permanent location for these services; they are on fly.io right now but that may cost money, but for now I just want TestFlight builds to use it.
2021-12-26 09:01:29 +00:00
Zac West
5c104f76e9 Multi-server (#1906)
## Summary
Most, but not all, of the changes necessary to support multi-server throughout the app and all its features.

## Screenshots
| Light | Dark |
| ----- | ---- |
| ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 52 24](https://user-images.githubusercontent.com/74188/143670011-9b9905ac-1b5b-4a82-b9f3-1490465c4ec5.png) | ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 52 26](https://user-images.githubusercontent.com/74188/143670012-0080230a-8f68-4f34-9691-db9f5e825a83.png) |
| ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 52 30](https://user-images.githubusercontent.com/74188/143670015-ceeac558-e039-4639-a186-b5001ab418b8.png) | ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 52 29](https://user-images.githubusercontent.com/74188/143670016-d72bb69d-83f5-4197-a742-59d208467258.png) |
| ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 52 47](https://user-images.githubusercontent.com/74188/143670021-6c90c40f-c2f1-4a33-aad9-da6626e99d9d.png) | ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 52 45](https://user-images.githubusercontent.com/74188/143670024-e99de69d-61d8-4e12-be73-a172242806a0.png) |
| ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 53 05](https://user-images.githubusercontent.com/74188/143670033-1a41ac7e-d4d1-458b-974e-2efdaf8e2288.png) | ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 53 03](https://user-images.githubusercontent.com/74188/143670049-baf4db64-64db-4bfb-88cf-4930f9e5661b.png) |
| ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 53 21](https://user-images.githubusercontent.com/74188/143670053-7ec794f1-857c-4ef6-a92a-5318e90ac6b6.png) | ![Simulator Screen Shot - iPhone 13 Pro - 2021-11-26 at 21 53 19](https://user-images.githubusercontent.com/74188/143670056-a6a5207c-3bba-49fc-b5c6-fc6fa8141f9c.png) |

## Any other notes
- Encapsulates all connectivity, token & server-specific knowledge in a Server model object which gets passed around.
- Updates various places throughout the app to know about and use Server rather than accessing said information through non-server-specific methods.
- Visually requests/notes server in places where it's ambiguous. For example, the Open Page widget will gain a subtitle if multiple servers are set up.
- Allows switching which server is shown in the WebViews. Note that this doesn't take into account multi-window support on iPad/macOS yet.

Most things will migrate successfully however adding an additional server causes things like Shortcuts to start erroring requiring you specify which to use in the particular Shortcut.

Future work necessary:
- Model objects currently clobber each other if their identifiers match. For example, both servers having a zone named `home` means one of them wins the fight for which is known to the app.
- Being remotely logged out on any account causes the app to require onboarding again, when instead it should only do that if the last known server is logged out.
2021-11-27 12:33:46 -08:00
Zac West
b053654829 Update to Xcode 13.1, add macOS 12 features (#1892)
* Update to Xcode 13.1, add macOS 12 features

* Settings check update

* Swap to Eureka fork which compiles

* Fix pushing twice during notification permission
2021-10-21 06:11:33 +00:00
Zac West
d939aa54d3 Reset badge to 0 automatically when opening the app (#1691)
## Summary
Adds a setting (defaulted on) to reset the badge to 0 when launching the app.

## Screenshots
| Light | Dark |
| -- | -- |
| ![Simulator Screen Shot - iPhone 12 Pro - 2021-06-25 at 10 23 38](https://user-images.githubusercontent.com/74188/123462674-72f35c80-d59f-11eb-93d7-eaa021a021a2.png) | ![Simulator Screen Shot - iPhone 12 Pro - 2021-06-25 at 10 23 40](https://user-images.githubusercontent.com/74188/123462699-7a1a6a80-d59f-11eb-9e23-238b7265e853.png) |

## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#549

## Any other notes
This is the general behavior on most iOS apps, and should make micro-managing the badge a little easier.
2021-06-25 11:36:41 -07:00
Zac West
1db6f3cc6e Local push on iOS (#1656)
Refs #1570 and home-assistant/core#50750. Fixes #1382.

## Summary
Adds a new app extension to do local push notifications on iOS 14 when connected to internal SSIDs.

## Screenshots
Adds a default-on setting to Internal URL:

| Light | Dark |
| -- | -- |
|  ![Simulator Screen Shot - iPhone 12 Pro - 2021-06-19 at 23 13 04](https://user-images.githubusercontent.com/74188/122664142-5cd73d80-d154-11eb-8378-600f0b82b3e4.png) | ![Simulator Screen Shot - iPhone 12 Pro - 2021-06-19 at 23 13 06](https://user-images.githubusercontent.com/74188/122664145-62cd1e80-d154-11eb-840d-0a0e86255bcb.png) |

## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#539

## Any other notes
- Updates the "you need always permission" warning in Internal URL editing to be vibrantly red, to really point out its importance.
- Sets the code signing for the app and the push target to 'manual' on device, hopefully for our internal team only. Special entitlements really do not play well with open source. Worth noting that it is not possible to test this feature without being on the HA team since it does not work in simulator (as far as I can tell) and running on-device requires entitlements.
- Moves commands into Shared in a slightly-easier registration mechanism, so we can share them in the local push extension.
2021-06-20 00:38:57 -07:00
Zac West
175adfaaf4 Local push on macOS (#1570)
Refs #1382 and home-assistant/core#50750.

## Summary
Uses (and requires) the core-2021.6 local push handling to subscribe to notification calls and show notifications without going through the Apple Push Notification Service.

## Screenshots
| Light | Dark |
| -- | -- |
| <img width="712" alt="Screen Shot 2021-06-06 at 18 08 59" src="https://user-images.githubusercontent.com/74188/120946730-57a8d600-c6f2-11eb-8dde-b03b42a0a03a.png"> | <img width="712" alt="Screen Shot 2021-06-06 at 18 09 09" src="https://user-images.githubusercontent.com/74188/120946737-5d9eb700-c6f2-11eb-8563-8d9b8d8e075b.png"> |

## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#539

## Any other notes
- Only works on macOS for this first round. The iOS implementation will be the same manager, but needs extensions scaffolding that I have to put together separately.
- iOS will also likely have a setting to control this behavior, since it has potential battery implications; macOS doesn't have such concerns.
- Adds tests around the parsing of the raw notification payloads that uses the same tests introduced in home-assistant/mobile-apps-fcm-push#55.
- Shows the state of the local push connectivity in Notifications. With multi-server support, this will probably need to be broken down by server, or moved into the server-specific configurations.

This also sets us up to support encrypted notifications, since we're now able to handle the service call's data without any kind of remote manipulation. Unfortunately Apple declined the entitlement which makes this extremely easy, so we'll still need to handle the "commands are unencrypted" nonsense.
2021-06-07 19:22:35 -07:00
Zac West
0731aeedb0 Add warning about Categories going away (#1624)
## Summary
Adds a description about notifications and the warning about the category change.

## Screenshots
<img width="350" src="https://user-images.githubusercontent.com/74188/117092707-e4d3c600-ad13-11eb-9d9c-187648a9f3b4.png"><img width="350" src="https://user-images.githubusercontent.com/74188/117092711-e604f300-ad13-11eb-8d1f-06407a16ca1e.png">

## Any other notes
Unifies the 'learn more' button pattern I've apparently grown attached to into a shared Eureka row.
2021-05-04 20:26:08 -07:00
Zac West
b5f4b2fe40 Enable Mac interface idiom & Macify settings (#1600)
Fixes #1305.

## Summary
Enables the new-to-macOS 11 interface idiom of Mac, which removes any interface scaling and brings more Mac-like UI.

## Screenshots
<img width="350" alt="image" src="https://user-images.githubusercontent.com/74188/115946708-ea115500-a477-11eb-9e42-378e76d6e136.png"><img width="350" alt="image" src="https://user-images.githubusercontent.com/74188/115946711-eed60900-a477-11eb-8591-fd01a3711787.png">

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a corresponding pull request in the Companion App Documentation repository (https://github.com/home-assistant/companion.home-assistant). Please add the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
- Updates Settings on Big Sur to use a toolbar to swap between root-level settings screens.
- Fixes blurry web view, only on Big Sur.
- `UISwitch` as a checkbox looks kind of weird; may need to do some Eureka-level changes to make SwitchRow use the `title` property on `UISwitch` to make it connected so the whole thing is clickable. This gets weird because the font size is larger for this property.
2021-04-24 07:08:30 +00:00
Zac West
28d9ec6fe0 Reset push ID when resetting everything else (#1559)
Fixes #1312.

## Summary
After resetting user defaults, where we store the push ID, this sets a new value through so it'll be used during the next registration.
2021-03-28 22:51:31 -07:00
Zac West
fd5bbdca9e Fix a couple iPad crashes due to popover source (#1530)
Fixes a crash in the new location history when tapping share, fixes another when tapping push ID.
2021-03-12 21:13:07 +00:00
Zac West
fbc2c7bd5e Handle my.home-assistant.io links on iOS (#1497)
## Summary
Handles being launched by universal links (e.g. https://my.home-assistant.io/redirect/logs) or via the url scheme `homeassistant://navigate/path/to/lovelace`.

## Screenshots
https://user-images.githubusercontent.com/74188/109757851-7487b780-7b9f-11eb-923d-5388964d85a5.mov

## Any other notes
This doesn't yet work on Mac, because my initial `WKWebView` implementation doesn't want to give us any events about URL schemes like `homeassistant://…` being tapped. I'm unsure how useful it'll be on Mac either way, but at least the `homeassistant://navigate/xyz` will still work there.
2021-03-04 02:28:59 +00:00
Zac West
3be1a97d24 Reshuffle Notifications settings screen (#1475)
## Summary
Moves Categories, Notifications and Rate Limits out of the root of the Notifications settings. Relocates and slims down the debug-related things.

## Screenshots
![Image](https://user-images.githubusercontent.com/74188/107476149-26484100-6b2a-11eb-93e8-7a48952e01c6.png)
![Image 2](https://user-images.githubusercontent.com/74188/107476208-39f3a780-6b2a-11eb-96ea-e57ec1a0a2a5.png)
![Image-2](https://user-images.githubusercontent.com/74188/107476251-50016800-6b2a-11eb-9af7-ddfda3274966.png)
![Image-2 2](https://user-images.githubusercontent.com/74188/107476286-627ba180-6b2a-11eb-9adf-8625bde61105.png)
![Image-2 3](https://user-images.githubusercontent.com/74188/107476329-78896200-6b2a-11eb-97e5-25b5f89f2872.png)

## Link to pull request in Documentation repository
Not a lot of doc changes for this one. They all speak generically enough that the same copy/directions works the same here.
Documentation: home-assistant/companion.home-assistant#461

## Any other notes
- Shows the rate limit's remaining value as its detail label in the row; updates both via pull-to-refresh in the Rate Limits screen.
- Fixes  the notification token being reset not updating the server with the new value immediately.
2021-02-11 07:47:33 +00:00
Zac West
640cca884b Add SwiftFormat to project (#1463)
Adds new fastlane lanes:
- `fastlane lint` which checks the linters
- `fastlane autocorrect` which applies the linters which can autocorrect (Rubocop, SwiftFormat)

Adds a build step to the Codegen abstract target which runs SwiftFormat in lint mode, pointing out what it's going to change when run.

Applies SwiftFormat to nearly all code -- exempts a few externally-sourced files and generated code.
2021-02-05 22:06:25 -08:00
Zac West
ce5374d1f3 Change Realm & Firebase to use their xcframeworks, halve build time (#1410)
Uses the binary distribution of Firebase and Realm, rather than compiling it on-device every time. These are gigantic dependencies that we don't really need to see the source for unless we want to.

I effectively copied the `.podspec.json` from the spec repo and updated it to use the downloads which contain the binary frameworks. Maintaining them should be as simple as changing the URL and version numbers for updates. Should that fail, reverting to the default pods still works without any non-Podfile changes.

Clean debug build time, iOS: 310s → 150s. macOS is now at 95s since it has less archs (no watchOS simulator). Tests in CI similarly decrease from 16m to 8m.
2021-01-23 23:46:28 -08:00
Zac West
466ae58bf6 Update dependencies, correct SwiftLint changes (#1280) 2020-11-18 11:13:28 -08:00
Zac West
f79e95302f Update dependencies, resolve warnings (#1221) 2020-10-20 21:22:47 -07:00
Zac West
77c72785ff Update a few more housekeeping things in the project (#1142)
- Combines all .entitlements into either: App-iOS, App-catalyst, WatchApp, Extension-iOS or Extension-catalyst.
- Cleans up and renames all the schemes to match target names
- Moves around several folders and deletes some old files.
- Converts Podfile to be hierarchical, rather than calling shared methods.
- Always runs MaterialDesignIcons script; aborts early if it's up-to-date.
- Updates all dependencies.
2020-10-03 16:05:19 -07:00