Bluelink: make Kia/Hyundai compatible
Some checks failed
Release / call-build-workflow (push) Has been cancelled
Release / Publish Docker :release (push) Has been cancelled
Release / Github & APT (push) Has been cancelled
Release / Demo (push) Has been cancelled
Release / Hassio Addon (push) Has been cancelled

This commit is contained in:
andig 2023-07-03 17:08:02 +02:00
parent 46569c73ac
commit 4433a2422d
2 changed files with 4 additions and 1 deletions

View file

@ -31,6 +31,7 @@ func NewHyundaiFromConfig(other map[string]interface{}) (api.Vehicle, error) {
CCSPApplicationID: bluelink.HyundaiAppID,
AuthClientID: "64621b96-0f0d-11ec-82a8-0242ac130003",
BrandAuthUrl: "https://eu-account.hyundai.com/auth/realms/euhyundaiidm/protocol/openid-connect/auth?client_id=%s&scope=openid%%20profile%%20email%%20phone&response_type=code&hkid_session_reset=true&redirect_uri=%s/api/v1/user/integration/redirect/login&ui_locales=%s&state=%s:%s",
PushType: "GCM",
}
return newBluelinkFromConfig("hyundai", other, settings)
@ -45,6 +46,7 @@ func NewKiaFromConfig(other map[string]interface{}) (api.Vehicle, error) {
CCSPApplicationID: bluelink.KiaAppID,
AuthClientID: "572e0304-5f8d-4b4c-9dd5-41aa84eed160",
BrandAuthUrl: "https://eu-account.kia.com/auth/realms/eukiaidm/protocol/openid-connect/auth?client_id=%s&scope=openid%%20profile%%20email%%20phone&response_type=code&hkid_session_reset=true&redirect_uri=%s/api/v1/user/integration/redirect/login&ui_locales=%s&state=%s:%s",
PushType: "APNS",
}
return newBluelinkFromConfig("kia", other, settings)

View file

@ -36,6 +36,7 @@ type Config struct {
BasicToken string
CCSPServiceID string
CCSPApplicationID string
PushType string
}
// Identity implements the Kia/Hyundai bluelink identity.
@ -68,7 +69,7 @@ func (v *Identity) getDeviceID() (string, error) {
uuid := uuid.NewString()
data := map[string]interface{}{
"pushRegId": lo.RandomString(64, []rune("0123456789ABCDEF")),
"pushType": "APNS",
"pushType": v.config.PushType,
"uuid": uuid,
}