Skip to content

Commit

Permalink
Merge pull request #160 from benderl/dev
Browse files Browse the repository at this point in the history
tesla and sungrow updates
  • Loading branch information
benderl authored Aug 23, 2022
2 parents 7056b32 + 0bbb876 commit b892868
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 31 deletions.
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

0 comments on commit b892868

Please sign in to comment.