Skip to content

Commit

Permalink
Fix downloading logs from relay's related meters
Browse files Browse the repository at this point in the history
fix #857
  • Loading branch information
fracz committed Aug 24, 2024
1 parent f8a68e8 commit 0fe9047
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 @@ -662,7 +662,7 @@ private function findTargetChannel(IODeviceChannel $channel): IODeviceChannel {
ChannelFunction::STAIRCASETIMER,
])) {
$channelConfig = $this->channelParamConfigTranslator->getConfig($channel);
$relatedMeasurementChannelId = $channelConfig['relatedChannelId'] ?? null;
$relatedMeasurementChannelId = $channelConfig['relatedMeterChannelId'] ?? null;
if ($relatedMeasurementChannelId) {
$targetChannel = $this->channelRepository->findForUser($channel->getUser(), $relatedMeasurementChannelId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ public function testGettingElectricityMeasurementsLogsCountFromRelatedRelay() {
/** @var SubjectConfigTranslator $paramsTranslator */
$paramsTranslator = self::$container->get(SubjectConfigTranslator::class);
$relayChannel = $this->device1->getChannels()[0];
$paramsTranslator->setConfig($relayChannel, ['relatedChannelId' => 4]);
$paramsTranslator->setConfig($relayChannel, ['relatedMeterChannelId' => 4]);
$this->persist($relayChannel);
$content = $this->getMeasurementLogsAscending($relayChannel->getId());
$this->ensureElectricityMeasurementLogsOrder($content, [854800, 854900, 855000]);
Expand All @@ -614,7 +614,7 @@ public function testGettingElectricityMeasurementsLogsCountFromRelatedStaircaseT
/** @var SubjectConfigTranslator $paramsTranslator */
$paramsTranslator = self::$container->get(SubjectConfigTranslator::class);
$staircaseTimerChannel = $this->device1->getChannels()[10];
$paramsTranslator->setConfig($staircaseTimerChannel, ['relatedChannelId' => 4]);
$paramsTranslator->setConfig($staircaseTimerChannel, ['relatedMeterChannelId' => 4]);
$this->persist($staircaseTimerChannel);
$content = $this->getMeasurementLogsAscending($staircaseTimerChannel->getId());
$this->ensureElectricityMeasurementLogsOrder($content, [854800, 854900, 855000]);
Expand Down

0 comments on commit 0fe9047

Please sign in to comment.