Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tesla and sungrow updates #160

Merged
merged 2 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions src/components/devices/sungrow/bat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@
Einstellungen für Sungrow Speicher
<span class="small">(Modul: {{ $options.name }})</span>
</openwb-base-heading>
<openwb-base-number-input
title="Geräteadresse"
required
:min="1"
:max="255"
:model-value="configuration.id"
@update:model-value="
updateConfiguration($event, 'configuration.id')
"
/>
<openwb-base-alert subtype="info">
Diese Komponente erfordert keine Einstellungen.
</openwb-base-alert>
</div>
</template>

Expand Down
10 changes: 0 additions & 10 deletions src/components/devices/sungrow/counter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@
updateConfiguration($event, 'configuration.version')
"
/>
<openwb-base-number-input
title="Geräteadresse"
required
:min="1"
:max="255"
:model-value="configuration.id"
@update:model-value="
updateConfiguration($event, 'configuration.id')
"
/>
</div>
</template>

Expand Down
10 changes: 10 additions & 0 deletions src/components/devices/sungrow/device.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@
updateConfiguration($event, 'configuration.port')
"
/>
<openwb-base-number-input
title="Geräteadresse"
required
:min="1"
:max="255"
:model-value="configuration.modbus_id"
@update:model-value="
updateConfiguration($event, 'configuration.modbus_id')
"
/>
</div>
</template>

Expand Down
13 changes: 3 additions & 10 deletions src/components/devices/sungrow/inverter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@
Einstellungen für Sungrow Wechselrichter
<span class="small">(Modul: {{ $options.name }})</span>
</openwb-base-heading>
<openwb-base-number-input
title="Geräteadresse"
required
:min="1"
:max="255"
:model-value="configuration.id"
@update:model-value="
updateConfiguration($event, 'configuration.id')
"
/>
<openwb-base-alert subtype="info">
Diese Komponente erfordert keine Einstellungen.
</openwb-base-alert>
</div>
</template>

Expand Down
63 changes: 62 additions & 1 deletion src/components/devices/tesla/vehicle_soc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,57 @@
Fahrzeug im Konto.
</template>
</openwb-base-number-input>
<openwb-base-text-input
title="Access Token"
pattern="^(ey).*"
required
:model-value="
configuration.token ? configuration.token.access_token : ''
"
@update:model-value="
updateConfiguration($event, 'configuration.token.access_token')
"
/>
<openwb-base-text-input
title="Refresh Token"
pattern="^(ey).*"
required
:model-value="
configuration.token ? configuration.token.refresh_token : ''
"
@update:model-value="
updateConfiguration($event, 'configuration.token.refresh_token')
"
/>
<openwb-base-number-input
title="Erstellt um"
required
:model-value="
configuration.token ? configuration.token.created_at : 0
"
@update:model-value="
updateConfiguration($event, 'configuration.token.created_at')
"
>
<template #help>
Unix Timestamp des Zeitpunktes, an dem das Token erzeugt wurde.
</template>
</openwb-base-number-input>
<openwb-base-number-input
title="Ungültig in"
unit="s"
required
:model-value="
configuration.token ? configuration.token.expires_in : 0
"
@update:model-value="
updateConfiguration($event, 'configuration.token.expires_in')
"
>
<template #help>
Zeitspanne in Sekunden, nach der das Token ungültig wird.
</template>
</openwb-base-number-input>
</div>
</template>

Expand All @@ -27,7 +78,17 @@ export default {
emits: ["update:configuration"],
props: {
configuration: { type: Object, required: true },
componentId: { required: true },
deviceId: { required: true },
},
data() {
return {
token: {
refresh_token: "",
access_token: "",
expires_in: 0,
created_at: 0,
},
};
},
methods: {
updateConfiguration(event, path = undefined) {
Expand Down