8 Commits

Author SHA1 Message Date
Fábio Oliveira
c49a5b072a
Migrate LocationHistoryList to SwiftUI (#3468)
<!-- 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
In this PR I set to migrate the LocationHistoryList to SwiftUI, to
reduce the dependency in Eureka. This screen was picked at random.

As this screen is presented from two different places, SettingsDetail
and Debug screens, also updated the code in the corresponding classes.

The LocationHistory list reacts to changes.

### LocationHistoryDetail
LocationHistoryDetailViewController also gained a SwiftUI wrapper in
order for it to be presented from the new LocationHistoryListView.
This wrapper syncs the navigation items between the wrapped View
Controller and the parent.
Move functionality also got migrated.

### Misc changes

- Support for M4 added to the Gemfile.lock (added automatically)
- New extension for safe subscripting in arrays added.

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
`LocationHistoryList item`
<img width="967" alt="Screenshot 2025-02-27 at 23 39 32"
src="https://github.com/user-attachments/assets/01576ced-ef97-4340-8353-e52a6fd14fac"
/>

`Empty LocationHistoryList`
<img width="955" alt="Screenshot 2025-02-27 at 23 40 56"
src="https://github.com/user-attachments/assets/303ae7c8-5fd6-40c1-87b4-e38098a175ea"
/>
2025-03-17 10:02:08 +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
bb53bdd5e5
Xcode 13 (#1841) 2021-09-18 19:42:29 -07:00
Zac West
cf186c9b66
Location updates for reduced accuracy (#1583)
## Summary
Updates to reduced location accuracy, manual updates, and error message display.

## Screenshots
<img width="300" src="https://user-images.githubusercontent.com/74188/114497723-9a10d380-9bd7-11eb-8980-5fff8364424e.png">

![Image](https://user-images.githubusercontent.com/74188/114497774-b57bde80-9bd7-11eb-8a76-24814ea2dc70.png)
![Image-2](https://user-images.githubusercontent.com/74188/114497839-d04e5300-9bd7-11eb-9e4a-9b5e5edf0532.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
- Shows error messages on the bottom of the screen, with as much room as they need. Fixes #311.
- Allows the reduced accuracy setting to send those poor accuracy results to the server. This should cut down on people who accidentally disabled full but don't realize it; seeing a location update with 3km precision should hopefully let 'em know.
- Adds a "Update Location" button to the Location settings.
- Updates the display of the "track_ios" hint (this one's for you Tom 😛).
2021-04-12 22:39:19 -07:00
Zac West
eef46b3249
Improve the location history screens (#1525)
## Summary
Adds more detail to the list and reshuffles detail to include up/down buttons to move through entries.

## Screenshots
<img width="350" src="https://user-images.githubusercontent.com/74188/110901125-ad6b0f00-82b8-11eb-9575-f0437e8bb313.png"><img width="350" src="https://user-images.githubusercontent.com/74188/110901132-af34d280-82b8-11eb-947f-4b967e7f38fe.png">
<img width="350" src="https://user-images.githubusercontent.com/74188/110898692-8f031480-82b4-11eb-9d51-61664224758e.png"><img width="350" src="https://user-images.githubusercontent.com/74188/110898697-90ccd800-82b4-11eb-9403-d3ae7038d5cd.png">

## Any other notes
This also adds more information to the debug file shared and improves the selected state handling in the list.
2021-03-12 06:39:30 +00:00
Zac West
5c132da07f
Add "Location History" to Settings (#1521)
## Summary
Hopefully improve debugging location issues by providing a visualization of what we know about a location update.

## Screenshots
<img width="350" src="https://user-images.githubusercontent.com/74188/110420951-5ca5ad00-8051-11eb-82d9-b81dc28e20b7.png"><img width="350" src="https://user-images.githubusercontent.com/74188/110420954-5dd6da00-8051-11eb-9d78-61783873b08a.png">
<img width="350" src="https://user-images.githubusercontent.com/74188/110420959-60393400-8051-11eb-906c-74e19096e274.png"><img width="350" src="https://user-images.githubusercontent.com/74188/110420961-616a6100-8051-11eb-9aee-334234a6c59c.png">
<img width="350" src="https://user-images.githubusercontent.com/74188/110420972-63ccbb00-8051-11eb-855c-4e7d41a4e16f.png"><img width="350" src="https://user-images.githubusercontent.com/74188/110420975-64fde800-8051-11eb-9876-c0cb0f682727.png">
<img width="350" src="https://user-images.githubusercontent.com/74188/110420986-692a0580-8051-11eb-976b-1e2be659bcae.png"><img width="350" src="https://user-images.githubusercontent.com/74188/110420988-6af3c900-8051-11eb-982c-aaa903f4af5d.png">

## Any other notes
- Shows a blue circle for zones, an orange circle for non-single-region zones' regions, a purple circle for location and its accuracy.
- Allows sharing a bunch of debug data about the location and region states.
- Allows clearing of location history.
2021-03-08 22:57:49 -08: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
4d9a530637
Reorganize files in repo, pull out build settings from pbxproj (#1140)
This is somewhat in prep of being able to make the project file generated, but also just organizes things into more concrete directory structures.

This pulls out _all_ of the build settings from the root level, and most from the target level, into xcconfigs.

The new directory structure looks like:

- Sources
  - App
    - (everything from HomeAssistant/)
  - WatchApp
  - Shared
  - MacBridge
  - Extensions
    - Intents
    - NotificationContent
    - NotificationService
    - Share
    - Today
    - Watch
    - Widgets
- Tests
  - App
  - UI
  - Shared

Somewhat intentionally, the file structure under these is not yet standardized/organized.

The project targets are now:

- App
- WatchApp
- Shared-iOS
- Shared-watchOS
- MacBridge
- Tests-App
- Tests-UI
- Tests-Shared
- Extension-Intents
- Extension-NotificationContent
- Extension-NotificationService
- Extension-Share
- Extension-Today
- Extension-Widget
- WatchExtension-Watch

This does not yet clean up resources vs. sources, nor does it handle some of the "it's in Sources/App but it's part of Shared" crossover directory issues.
2020-10-03 00:15:04 -07:00