Skip to content

Add configurable site efficiency alert - #209

Merged
mukama merged 4 commits into
tetherto:developfrom
shrutesh-tether:feat/site-eff-alert
Aug 31, 2026
Merged

Add configurable site efficiency alert#209
mukama merged 4 commits into
tetherto:developfrom
shrutesh-tether:feat/site-eff-alert

Conversation

@shrutesh-tether

@shrutesh-tether shrutesh-tether commented Aug 31, 2026

Copy link
Copy Markdown

Ticket

Add configurable site efficiency alert

@shrutesh-tether
shrutesh-tether marked this pull request as ready for review August 31, 2026 10:46
dcsEnabled
? fetchDcsThing(ctx, { id: 1, code: 1, type: 1, tags: 1, ...DCS_POWER_METER_FIELDS })
: Promise.resolve(null),
dcsEnabled ? Promise.resolve(null) : getSiteConsumption(ctx)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since it's the same flag may be use single condition -
dcsEnabled
? fetchDcsThing(ctx, { id: 1, code: 1, type: 1, tags: 1, ...DCS_POWER_METER_FIELDS })
: getSiteConsumption(ctx)

for (const { key, severity } of SITE_EFFICIENCY_ALERT_TIERS) {
const conf = alertParams?.[key]
const threshold = conf?.maxSiteEfficiencyWThs
if (!conf?.enabled || typeof threshold !== 'number') continue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the config values first so computeSiteEfficiencyWPerTh doesn't get called every time.

mukama
mukama previously approved these changes Aug 31, 2026
@mukama
mukama merged commit 55de8ec into tetherto:develop Aug 31, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants