Added namespace
This commit is contained in:
parent
f8ad913c02
commit
7ee803dc10
@ -12,19 +12,19 @@ async function scrape() {
|
|||||||
map[found[1]] = found[2];
|
map[found[1]] = found[2];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
model: map["Model Name"],
|
ups_model: map["Model Name"],
|
||||||
vendor: map["Power Supply by"],
|
ups_vendor: map["Power Supply by"],
|
||||||
state: map["State"],
|
ups_state: map["State"],
|
||||||
charge: Number(/\d+/g.exec(map["Battery Capacity"])[0]) / 100,
|
ups_charge: Number(/\d+/g.exec(map["Battery Capacity"])[0]) / 100,
|
||||||
remaining: map["Remaining Runtime"],
|
ups_remaining: map["Remaining Runtime"],
|
||||||
rated_voltage: Number(/\d+/g.exec(map["Rating Voltage"])[0]),
|
ups_rated_voltage: Number(/\d+/g.exec(map["Rating Voltage"])[0]),
|
||||||
rated_wattage: Number(/\d+/g.exec(map["Rating Power"])[0]),
|
ups_rated_wattage: Number(/\d+/g.exec(map["Rating Power"])[0]),
|
||||||
input_voltage: Number(/\d+/g.exec(map["Utility Voltage"])[0]),
|
ups_input_voltage: Number(/\d+/g.exec(map["Utility Voltage"])[0]),
|
||||||
output_voltage: Number(/\d+/g.exec(map["Output Voltage"])[0]),
|
ups_output_voltage: Number(/\d+/g.exec(map["Output Voltage"])[0]),
|
||||||
load_wattage: Number(/\d+/g.exec(map["Load"])[0]),
|
ups_load_wattage: Number(/\d+/g.exec(map["Load"])[0]),
|
||||||
load_percentage: Number(/(\d+) %/g.exec(map["Load"])[1]) / 100,
|
ups_load_percentage: Number(/(\d+) %/g.exec(map["Load"])[1]) / 100,
|
||||||
last_test: map["Test Result"],
|
ups_last_test: map["Test Result"],
|
||||||
last_outage: map["Last Power Event"],
|
ups_last_outage: map["Last Power Event"],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user