16 Commits

Author SHA1 Message Date
Bruno Pantaleão Gonçalves
74afb73e62
Subscribe only to domains that the app has usage for (#3154)
<!-- 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 -->
Subscribe only to domains that the app has usage for, so we dont keep
getting state updates for entities the app has no feature related to
that.

Pending: https://github.com/home-assistant/HAKit/pull/67

## 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. -->
2024-12-03 18:28:16 +01:00
Bruno Pantaleão Gonçalves
8f3c46a1ef
Replace caches by separate database for entities which domains relate to app usage (#2981)
<!-- 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. -->
2024-09-09 14:50:20 +02:00
Bruno Pantaleão Gonçalves
034e683f39
Add iOS 18 Open Page Control (#2975)
<!-- 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. -->
![CleanShot 2024-09-04 at 13 52
19@2x](https://github.com/user-attachments/assets/34905538-4c90-4f7c-8d47-41555554654f)

## 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. -->
2024-09-04 14:57:34 +02:00
Bruno Pantaleão Gonçalves
186aea4fa7
Create Watch Home from iOS (#2944)
<!-- 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 -->

- Create watch home from iPhone
- Configure Assist for watch from iPhone
- Deprecate message for iOS Actions
- Use Scripts or Scenes directly
- Show/Hide Assist in Apple Watch
- Options to require confirmation before running watch item
(script/scene/action)

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
![CleanShot 2024-08-27 at 15 52
39@2x](https://github.com/user-attachments/assets/5360c60d-9638-40b9-b799-d12668bd579f)


https://github.com/user-attachments/assets/1e4509f8-45e5-4b39-bfdc-62f9bce64617


## 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. -->
2024-08-28 09:45:07 +02:00
Bruno Pantaleão Gonçalves
c65519658e
Add "Run Script" AppIntent and Widget (#2900)
<!-- 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 -->
Pending:
- Allow color customisation
- Choose to receive or not notification confirmation

## 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. -->
2024-08-06 16:24:08 +02: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
Bruno Pantaleão Gonçalves
02a8457410
Add QR code scanner (#2576)
<!-- 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 -->
Add QR code scanner that can be triggered from HA and receive result
response
## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
  


https://github.com/home-assistant/iOS/assets/5808343/0e4d4f18-7507-44f2-8844-e701448943dd


## 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. -->
2024-02-19 10:53:59 +01:00
Bruno Pantaleão Gonçalves
8ad58aeed2
Improve iOS Actions, facilitate automation creation (#2541) 2024-01-30 09:10:39 +01:00
Zac West
66b18db519
Reconnect if the WebView WebSocket connection is likely disconnected (#1987)
Fixes #1801 by working around the Apple bug.
Refs home-assistant/frontend#10819.
Requires core-2021.12.0b6 or newer.

## Summary
When the app has been in the background for a while without executing, reset the WebSocket connection in the WebView when execution begins again.

Also implements the new `theme-update` external bus command since it will log as an unhandled message. This likely means we're over-updating theme colors, but that is relatively cheap to do and doesn't cause harm.

## Any other notes
This works around a bug in NSURLSession's WebSocket implementation -- which WKWebView moved to in iOS 15 -- where it cannot reliably detect network connectivity failures due to extended backgrounding. Eventually it'll get a "connection reset by peer" or other error, but in the meantime it reports itself as still connected, thus leaving our WebView thinking it's connected but anything sent isn't sent and nothing is received.
2021-12-10 07:52:56 +00:00
Zac West
cea0b16936
Update dependencies (#1883)
- Updates several dependencies
- Removes Lokalise -- if we can't do it on Catalyst, it doesn't feel worth it to do it elsewhere
- Migrates the NotificationTestCases from a Podspec that keeps having issues to a fastlane script which copies in the latest ones
2021-10-16 15:19:41 -07:00
Zac West
a2491d632d
Minor fixes for open page widget (#1867)
## Summary
- Fixes e.g. HACS (which is `hacs:hacs`) icons showing the A/B icon. We now fall back to the outline cog.
- Hide panels without the "show in sidebar" option. We get them in the response, but e.g. the title is incorrect.
- Changes sort order in the automatic version to more closely align with the frontend.
- Fixes a case where chosen panels in the past would fail to be updated due to being at the tail end of the array in the API response, due to truncating to widget size _before_ updating.

## Screenshots
![image](https://user-images.githubusercontent.com/74188/135203919-d2951c9a-0bfe-4eb4-8285-a74f9c546882.png)
2021-09-29 04:49:43 +00:00
Zac West
4992c97b49
"Open page" widget (#1863)
## Summary
Adds to Shortcuts and Widgets the ability to open a particular page/panel in Lovelace.

## Screenshots
| State | 1 | 2 |
| -- | -- | -- |
| Empty | ![Simulator Screen Shot - iPad Pro (12 9-inch) (5th generation) - 2021-09-27 at 22 26 11](https://user-images.githubusercontent.com/74188/135033260-a54ac04e-e2dd-4da7-a497-b04d5297db8b.png) | ![Simulator Screen Shot - iPad Pro (12 9-inch) (5th generation) - 2021-09-27 at 22 26 57](https://user-images.githubusercontent.com/74188/135033274-d7dee9da-48f6-4219-8e47-c128746e26dc.png) |
| Contents | ![Simulator Screen Shot - iPad Pro (12 9-inch) (5th generation) - 2021-09-27 at 22 53 26](https://user-images.githubusercontent.com/74188/135033294-52953ad1-c73c-49ea-bc7b-919ce5c35068.png) | ![Simulator Screen Shot - iPad Pro (12 9-inch) (5th generation) - 2021-09-27 at 22 53 33](https://user-images.githubusercontent.com/74188/135033305-2d6c2e93-9ef0-485c-a533-e6ee34e17bfa.png) |
| Shortcuts | ![Simulator Screen Shot - iPad Pro (12 9-inch) (5th generation) - 2021-09-27 at 23 17 58](https://user-images.githubusercontent.com/74188/135033520-d5a848ca-c4f5-41aa-bba8-a27b9c80489a.png) | ![Simulator Screen Shot - iPad Pro (12 9-inch) (5th generation) - 2021-09-27 at 23 18 06](https://user-images.githubusercontent.com/74188/135033531-a2102fdc-c834-4994-bc4d-c97d7af93342.png) |

## Any other notes
A good starting point for widgets which need cached information. This one is simple: 1 request that is a small JSON payload that needs to be saved. This can start to get more complex later.

- Adds an on-disk cache backed by Codable, which we use to cache panels in the widget (for data) and in the app (to see if we need to reload the widget).
- Fixes some issues and crashes with opening the action of a widget multiple times in a row.
- Adds support for grabbing frontend localizations from Lokalise and uses them for panel localization.
2021-09-27 23:24:06 -07:00
Zac West
45ed8c5fb4
Update look and feel of settings (#1578)
## Summary
Updates the root of settings to have a few less options, use the new iOS 13+ 'inset grouped' style look with icons.

## Screenshots
![Image](https://user-images.githubusercontent.com/74188/114317710-3d6dc580-9abe-11eb-9dc1-264403eeaa9b.png)
![Image 2](https://user-images.githubusercontent.com/74188/114317706-3b0b6b80-9abe-11eb-8e56-8593ea859461.png)
<img width="350" alt="Screen Shot 2021-04-11 at 12 07 01" src="https://user-images.githubusercontent.com/74188/114317762-7d34ad00-9abe-11eb-8373-32c1da77df8d.png"><img width="350" alt="Screen Shot 2021-04-11 at 12 06 54" src="https://user-images.githubusercontent.com/74188/114317765-80c83400-9abe-11eb-8d9d-b60fd1f0d224.png">
<img width="350" alt="Screen Shot 2021-04-11 at 12 07 14" src="https://user-images.githubusercontent.com/74188/114317770-858ce800-9abe-11eb-82e5-8c7eb862dabb.png"><img width="350" alt="Screen Shot 2021-04-11 at 12 07 09" src="https://user-images.githubusercontent.com/74188/114317773-8756ab80-9abe-11eb-84d1-274216c550c7.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
- Moves a few things into 'Debugging' like resetting the app. Duplicates the entry point into location history (still in Location) since it's relevant there too.
- Removes the local 'AuthenticatedUser' cache (retrieved via WebView's WebSocket) in favor of the HAKit representation.
- Adds a debug-only "Add Server" button to the server list, which currently crashes when tapped.
2021-04-11 12:39:38 -07: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
293a149ba2
Add admin-only filtering for server-based alerts (#1401)
Fixes #1391.

## Summary
Adds optional flag `admin_only` to the alert definition. Doesn't show them when it's set and the current user isn't an admin.

## Link to pull request in Documentation repository
n/a
2021-01-22 22:32:58 -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