84 Commits

Author SHA1 Message Date
Copilot
3f25cd80ab
Add automation domain and iOS control widget (#4120)
## Summary

Adds support for Home Assistant automations in the iOS app. Automations
can now be triggered from iOS Control Center widgets (iOS 18+), similar
to existing script and scene controls.

**Domain & Model**
- Added `automation` domain with robot icon and `trigger` service
- Included automation in `AppEntitiesModel` tracked domains for database
caching
- Added to CarPlay supported domains

**Control Widget** (iOS 18+)
- `ControlAutomation` - Main control widget
- `AutomationAppIntent` - Triggers `automation.trigger` service
- `IntentAutomationEntity` - Entity queries and selection
- `ControlAutomationsValueProvider` - Configuration with custom
icons/text

**Pattern**
Follows existing `ControlScript` and `ControlScene` implementation
patterns for consistency.

**Tests**
- Updated `testWidgetsKindCasesValues` to include assertion for
`controlAutomation` case
- Updated widget kind count validation from 25 to 26

## Screenshots

N/A - Control widgets are system UI and cannot be screenshotted during
development. Widget appears in Control Center configuration with
automation icon and allows selection from available automations.

## Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

## Any other notes

Localization strings added for English only. Additional languages will
need translation via the standard localization workflow.

<!-- START COPILOT CODING AGENT SUFFIX -->



<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 1 - Add "automation" in AppEntitiesModel domains
> 2 - Create an iOS control for running automation like it exist for
ControlScript


</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/home-assistant/iOS/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>
2025-12-22 10:58:37 +00:00
Bruno Pantaleão Gonçalves
7119b8a557
Add fan domain to app database updater (#4114) 2025-12-19 09:46:08 +00:00
Bruno Pantaleão Gonçalves
615da4c976
Add experimental native WebRTC Player (#3703) 2025-07-07 23:30:02 +02:00
Bruno Pantaleão Gonçalves
7e334405c7
Add device class to app database (#3548)
<!-- 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-04-16 16:43:29 +02:00
Bruno Pantaleão Gonçalves
b70242c8f8
Move magic item execution out of API file (#3507)
<!-- 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-03-27 16:27:52 +01:00
Bruno Pantaleão Gonçalves
0c419df2a3
Add "triggerSource" to service calls (#3489)
<!-- 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 -->
To leverage the features from the legacy iOS Actions, this PR adds
triggerSource to all service calls in the app so users can automate
based on which device (watch/phone/car) triggered that.

## 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-03-19 15:26:17 +01:00
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
Bruno Pantaleão Gonçalves
3b1903a23a
Improve database creation and usage avoiding recursive environment call before its init (#3455)
<!-- 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-02-24 16:11:17 +01:00
Bruno Pantaleão Gonçalves
02e5fa6692
Save ClientEvents on local json file instead of GRDB to avoid crashes (#3378) 2025-01-30 12:55:32 +01:00
Bruno Pantaleão Gonçalves
c5b9cae488
Improve logs for entities model updater (#3283)
<!-- 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-12-17 14:49:12 +00:00
Bruno Pantaleão Gonçalves
94fe0c568f
Add more domains for sensors widget (#3270)
<!-- 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 -->
CC: @Penait1 
## 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-12 18:08:11 +01:00
Bruno Pantaleão Gonçalves
9eb6f4f524
Add missing CarPlay-used domains to app database sync (#3261)
<!-- 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-12-11 15:57:36 +01:00
Bruno Pantaleão Gonçalves
f2c35267f3
Periodic update app entities instead of subscribing to state updates (#3231)
<!-- 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 -->
This PR will change the approach of how the app keeps it's data updated
by not subscribing to all state changes and only periodic updating it's
app entities instead.
This will avoid several issues where users experience their app to
freeze due to 9k entities updating every second and notifying the app.

## 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-05 10:28:45 +01:00
Bruno Pantaleão Gonçalves
36d4daccae
Add person domain to states subscription (#3229) 2024-12-04 13:36:06 +01:00
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
2513607f6f
Prevent AppEntities auto init in extensions (#3218)
<!-- 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-12-02 12:02:31 +01:00
Bruno Pantaleão Gonçalves
188904beb0
Migrate client events list to SwiftUI and GRDB for database (#3206) 2024-11-28 04:43:38 +01:00
Bruno Pantaleão Gonçalves
91dcc4d427
Reduce database updates throttling (#3205) 2024-11-27 22:24:17 +01:00
Bruno Pantaleão Gonçalves
2896f4a454
Assist improvements and revert optional connection access (#3201)
<!-- 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-11-27 15:42:33 +01:00
Bruno Pantaleão Gonçalves
dd0e51b32d
Separate entities model cache per server (#3197)
<!-- 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-11-26 11:57:17 +01:00
Bruno Pantaleão Gonçalves
b1c3d8949e
Add extra logging for database updates (#3185)
<!-- 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-11-22 12:31:15 +01:00
Bruno Pantaleão Gonçalves
ee8386b8cb
Prevent too frequent updates to database (#3183) 2024-11-22 10:12:49 +01:00
Bruno Pantaleão Gonçalves
38f31e9b6c
Fix entities database sync (#3182) 2024-11-21 01:54:12 +01:00
Bruno Pantaleão Gonçalves
c088157ca7
Unsubscribe model manager when in background (#3179) 2024-11-20 19:31:03 +01:00
Bruno Pantaleão Gonçalves
e728c6f0ea
Prevent server deletion and inform user it is unauthenticated (#3171) 2024-11-20 18:16:44 +01:00
Bruno Pantaleão Gonçalves
13ac4e4a87
Making API connection optional given activeURL is now optional as well (#3169)
<!-- 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-11-18 15:07:18 +01:00
Bruno Pantaleão Gonçalves
dd0e080a30
Use entity category "diagnostic" for App Version (#2899) 2024-08-02 12:48:18 +02:00
Bruno Pantaleão Gonçalves
4daad9416b
Fix watch crash (Realm migration not called) (#2886)
<!-- 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 -->
For some reason Realm database migration was not being called event
though scheme version was already bumped to 28, apparently this was
caused by watch complication that was accessing realm passing specific
object types

Test process:

- Checkout commit c257fa21f62acb964edb28c6d3db0796a86731f1
- Run App in iPhone and watch (with some Actions created)
- Checkout commit 2c8470e5fec8a6c715bfe7de113b3f35c37a4e84
- Run App in iPhone and watch
> - this was crashing in watch and now it is running the migration
block.

## 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-07-31 16:00:58 +02:00
Bruno Pantaleão Gonçalves
2c8470e5fe
Add Actions custom colors back (#2880)
<!-- 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 -->
Based on user feedback, color customisation is important on their iOS
Actions, in widgets and Apple Watch, so this PR adds this option back
but with a little modification, we will first enforce the tile card
design as the standard, if the user wants to use custom colors it has to
enable "custom colors" toggle in actions configuration screen. (I will
also make a PR in Core to be able to configure that via YAML)

This PR also makes the "default" background color for watch items to be
dark instead of white.

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


![IMG_5128](https://github.com/user-attachments/assets/75fa1b9f-0c84-463c-88ac-779e64eb0895)

![incoming-73C08CA7-76A4-4728-827B-B0220D2A83F9](https://github.com/user-attachments/assets/35cbd770-5bbc-490c-827e-463edec2cf55)

![incoming-56AC10D8-6709-4511-B37D-FB5D76A193A1](https://github.com/user-attachments/assets/12d69b5a-d138-43a1-863f-b111b23c6fa1)


## 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-07-30 10:05:40 +02:00
Bruno Pantaleão Gonçalves
05f51d800e
Avoid auto enabling scenes (#2758)
<!-- 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-05-06 09:49:42 +02:00
Bruno Pantaleão Gonçalves
8ad54b6cf1
Add button to manually sync server Actions (#2733)
<!-- 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 -->
Some users have pointed out thei Actions sometimes are not sync, this is
to help out define if the time of the sync is relevant.

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
<img width="703" alt="Screenshot 2024-04-22 at 13 41 04"
src="https://github.com/home-assistant/iOS/assets/5808343/41cd1ff7-7cc3-4cf5-9814-fe59289553f9">

## 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-04-23 12:59:53 +02:00
Michal Šrůtek
7de47c6e62
static var to static let (#2642)
<!-- 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 -->

- `static let` plays nicely with modern Swift concurrency (async/await)
- `static let` makes it impossible to mutate the values - causing
undefined behavior in some cases
2024-03-25 11:57:48 +01:00
Michal Šrůtek
5dc86c82da
🚮 Remove unused baseAction (#2645)
<!-- 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
Remove unused `baseAction` which got there probably during a
rebase/merge.

## Screenshots

<img width="963" alt="unused"
src="https://github.com/home-assistant/iOS/assets/35694712/4a7faf38-feff-4459-9f1b-2aae88c58e27">
2024-03-18 11:01:55 +01:00
Michal Šrůtek
3146e08aac
Available checks cleanup for iOS 15 and watchOS 8 (#2622)
<!-- 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 -->

As the [minimum watchOS is
8](https://github.com/home-assistant/iOS/pull/2609) and [minimum iOS
15](https://github.com/home-assistant/iOS/pull/2469), this PR removes
redundant `#available` checks.

Co-authored-by: Bruno Pantaleão Gonçalves <bruno.ing879@gmail.com>
2024-03-04 15:36:55 +01:00
Michal Šrůtek
08781c19f0
Remove default options parameter (#2621)
<!-- 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 -->
This PR removes the `options` parameters which use the default value.

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

<img width="1014" alt="Screenshot 2024-03-03 at 21 17 55"
src="https://github.com/home-assistant/iOS/assets/35694712/85324caf-c36d-4366-a9f8-9c349192a361">
<img width="1049" alt="Screenshot 2024-03-03 at 21 17 17"
src="https://github.com/home-assistant/iOS/assets/35694712/cebddbe6-8ea4-415e-b12a-0e35f86bf5a3">
<img width="1022" alt="Screenshot 2024-03-03 at 21 16 53"
src="https://github.com/home-assistant/iOS/assets/35694712/ccccb902-9791-42f6-8868-5900093c40ae">
<img width="991" alt="Screenshot 2024-03-03 at 21 16 28"
src="https://github.com/home-assistant/iOS/assets/35694712/f2f33685-a55c-47ed-a555-8cc0fc1561ce">
<img width="1329" alt="Screenshot 2024-03-03 at 21 16 00"
src="https://github.com/home-assistant/iOS/assets/35694712/2dc156da-29d6-44e4-a064-4fbdb79139bd">
<img width="1130" alt="Screenshot 2024-03-03 at 21 14 53"
src="https://github.com/home-assistant/iOS/assets/35694712/628dd2ff-5bba-4ee7-912b-cdbdf73f18b2">
2024-03-04 09:28:53 +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
Bruno Pantaleão Gonçalves
34765e8621
Add toggle to make action visible in CarPlay (#2529)
<!-- 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. -->
<img width="584" alt="Screenshot 2024-01-18 at 02 24 31"
src="https://github.com/home-assistant/iOS/assets/5808343/bc037f5d-d916-4715-aaf1-2b823014a99a">


## 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-01-18 16:09:02 +01:00
Bruno Pantaleão Gonçalves
e9c85b3f7a
Drop iOS 12, 13 and 14 support (#2469)
<!-- 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 -->
Drop support for iOS 12 and 13.

## 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. -->
2023-12-27 16:50:11 +01:00
David Beitey
7c052a9f1d
Update repo name and URL in CONTRIBUTING docs (#2210)
<!-- 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 -->
This clarifies in the contributing docs which project is being
contributed to and which repo to work against - previously it said just
"Home Assistant" which could be confusing.

This also updates the repo URL in the contributing docs and at the same
time several code comments that also used the older repo URL.

## 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. -->
2022-09-30 16:27:39 +00:00
Zac West
f9bc5a0aee
Fix overlapping zones with zone-only privacy level (#2078)
Fixes #2064.

## Summary
When multiple zones contain the location when sending zone names only to the server, prefers the smaller radius.
2022-02-11 15:54:09 -08:00
Zac West
370fd18735
Server privacy setting for sensors (#2019)
## Summary
When set to "None", all sensors sent to the server will be redacted.

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

## Any other notes
This also updates location when changing location privacy & sensors when changing sensor privacy, so the data server-side will be most-up-to-date.
2021-12-20 23:15:40 -08:00
Zac West
e3d1d1c8ac
Setting for types of locations sent to a server (#2015)
Requires home-assistant/core#62243.

## Summary
Allows sending exact locations (current behavior, gps coordinates), no locations (sets the device tracker to 'unknown' effectively), and zone-only locations (we send `home`, `other_zone_name` or `not_home` only).

## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#639
2021-12-20 15:13:11 -08:00
Zac West
6ae54f679f
Fix server identifier of non-synced actions & complications for deleted servers (#1992)
## Summary
When a server is deleted, we now update the identifiers of any locally-defined actions or complications to point to the first server. We want to avoid ever having a server identifier pointing to a deleted server so we can trust the identifiers more.

## Any other notes
Deleting in this case would be bad as it's an unexpected data loss. I can imagine someone deletes and re-adds the server (potentially the last one, too), or other maintenance tasks.
2021-12-12 10:19:52 -08:00
Zac West
b465c94145
Fix complications not updating in 2021.12 (#1977)
Fixes #1955.

## Summary
We were not updating any complications watch-side, so any updates exclusively came from the iOS app's updating them.

## Any other notes
Complications weren't syncing over to the watch with their serverIdentifier value set, so when we went to update none of the API instances thought their server had any complications needing updating.
2021-12-07 03:16:10 +00:00
Zac West
bcdcddb826
Fix server seeming to be editable for scene actions & color when disabled (#1948)
Fixes bad logic in the "can server identifier be edited?" check, and colors the detail label of the server select row like a field row in other Eureka contexts.
2021-11-29 19:38:17 -08:00
Zac West
f728fb5588
Fix scene actions not setting the right server or sort order (#1941) 2021-11-28 18:47:42 +00:00
Zac West
a3cf326d7b
Store zones by server, allowing duplicate entity ids (#1936)
## Summary
Stores a zone from s1 in Realm like `s1/zone.name` rather than `zone.name` so it's distinct from `s2/zone.name`. This is most apparent for `zone.home` which universally conflicts.

## Any other notes
This does not yet extend to the other synced models as we use their identifier in persisted locations that aren't programmatically changeable (e.g. action IDs are stored in intents). Zones don't pose such a problem, and are the most likely suspect to even have duplicates right now; scenes, actions, and deprecated notification categories can be done after an external beta.
2021-11-28 04:39: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
4c39d8672d
Add testing to onboarding authentication/login handling (#1888) 2021-10-25 21:04:05 -07: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