Skip to content

Commit

Permalink
adding possiblity of using Electricity Maps integration for showing d…
Browse files Browse the repository at this point in the history
…ata on Carbon Footprint Widget
  • Loading branch information
nkrasko committed Jan 3, 2025
1 parent c35ff18 commit c0f4505
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cloud_services/electricity_maps/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ properties:
zone:
type: string
display_name: World Zone
in_dashboard:
type: boolean
display_name: Use for Carboon Footprint Dashboard

telemetry:
status:
Expand Down Expand Up @@ -117,6 +120,9 @@ commands:
display_name: Longitude
type: string
required: true
in_dashboard:
type: boolean
display_name: Use for Carboon Footprint Dashboard

read_configuration:
display_name: Read Config Parameters
Expand Down
3 changes: 3 additions & 0 deletions cloud_services/electricity_maps/src/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ active_alerts = {}
TOKEN_CONFIG = 'token'
LAT_CONFIG = 'lat'
LON_CONFIG = 'lon'
IN_DASHBOARD_CONFIG = 'in_dashboard'
ZONE = nil

function get_config()
Expand Down Expand Up @@ -118,6 +119,7 @@ function main()
[TOKEN_CONFIG] = { type = 'string', required = true },
[LON_CONFIG] = { type = 'string', required = true },
[LAT_CONFIG] = { type = 'string', required = true },
[IN_DASHBOARD_CONFIG] = { type = 'boolean', default = false, required = false },
})
scheduler.add(5000, send_properties)
scheduler.add(120000, prepare_telemetry)
Expand All @@ -133,6 +135,7 @@ function send_properties()
lat = data['lat'],
lon = data['lon'],
zone = ZONE,
in_dashboard = data['in_dashboard'],
})
end
end
Expand Down

0 comments on commit c0f4505

Please # to comment.