Skip to content

Commit

Permalink
fix(station): Shelly polling interval wrong unit
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandarDev committed Oct 20, 2023
1 parent 9d0e9d5 commit 200631f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private async Task StartDeviceAsync(IEntityDetails entity, CancellationToken can
}

var pollingInterval = configuration.PollingInterval.HasValue
? TimeSpan.FromMicroseconds(Math.Max(1000, configuration.PollingInterval.Value))
? TimeSpan.FromMilliseconds(Math.Max(1000, configuration.PollingInterval.Value))
: TimeSpan.FromSeconds(30);

try
Expand Down
4 changes: 2 additions & 2 deletions web/apps/app/components/widgets/parts/WidgetEnergy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function WidgetEnergy({ config, onOptions }: WidgetSharedProps<Co

const columns = config?.columns ?? 4;
const rows = config?.rows ?? 2;
const duration = config?.duration ?? 0;
const duration = config?.duration ?? 24 * 60 * 60 * 1000;

const contacts = useContacts(config?.target ?? []);
const usageWats = parseFloat(contacts.at(0)?.data?.valueSerialized ?? 'NaN');
Expand Down Expand Up @@ -86,7 +86,7 @@ export default function WidgetEnergy({ config, onOptions }: WidgetSharedProps<Co
id: i.timeStamp.toUTCString(),
value: i.valueSerialized ?? ''
})) ?? []}
durationMs={60 * 60 * 1000}
durationMs={duration}
width={columns * 84 - 2}
height={rows * 25}
hideLegend
Expand Down

0 comments on commit 200631f

Please sign in to comment.