iOS/Sources/Shared/Services/ThreadCredential.swift
Bruno Pantaleão Gonçalves 00f311b6f0
Add thread credentials management screen (#2606)
<!-- 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 screen to list all thread credentials in keychain + transfer to HA.
This screen will also work as a way to visually validate when we start
transferring HA thread credentials in Apple keychain.

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->
<img width="2126" alt="Screenshot 2024-02-29 at 11 17 12"
src="https://github.com/home-assistant/iOS/assets/5808343/033ec96d-e8f0-4f91-b1e8-53dd207873e2">


## 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-03-04 14:07:47 +01:00

44 lines
1.4 KiB
Swift

import Foundation
public struct ThreadCredential {
public init(
networkName: String,
networkKey: String,
extendedPANID: String,
borderAgentID: String,
// Apple uses it when referencing border agent ID
macExtendedAddress: String,
activeOperationalDataSet: String,
pskc: String,
channel: UInt8,
panID: String,
creationDate: Date? = nil,
lastModificationDate: Date? = nil
) {
self.networkName = networkName
self.networkKey = networkKey
self.extendedPANID = extendedPANID
self.borderAgentID = borderAgentID
self.macExtendedAddress = macExtendedAddress
self.activeOperationalDataSet = activeOperationalDataSet
self.pskc = pskc
self.channel = channel
self.panID = panID
self.creationDate = creationDate
self.lastModificationDate = lastModificationDate
}
public var autogeneratedId = UUID().uuidString
public let networkName: String
public let networkKey: String
public let extendedPANID: String
public let borderAgentID: String
public let macExtendedAddress: String
public let activeOperationalDataSet: String
public let pskc: String
public let channel: UInt8
public let panID: String
public let creationDate: Date?
public let lastModificationDate: Date?
}