Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,7 @@
"empty": "Alerts are set on radios in your Atlas. Add a radio there first.",
"requestAttention": "You are always told when one of your telemetry requests needs attention.",
"needsGoneQuiet": "Turn on {{name}} first.",
"goneQuietHint": "Short windows can false-alarm on radios that are only heard through their adverts.",
"summaryNone": "No alerts on",
"summaryOnCount_one": "{{count}} alert on",
"summaryOnCount_other": "{{count}} alerts on",
Expand All @@ -1431,6 +1432,7 @@
"kind": {
"gone_quiet": "Gone quiet",
"back_online": "Back online",
"telemetry_stopped": "Telemetry stopped",
"battery_low": "Battery low",
"battery_falling": "Battery falling",
"rebooted": "Rebooted",
Expand Down Expand Up @@ -1478,6 +1480,7 @@
"when": {
"gone_quiet": "When the radio has not been heard for this long.",
"back_online": "When the radio is heard again after it went quiet.",
"telemetry_stopped": "When no telemetry has arrived for this long.",
"battery_low": "When the battery stays below this voltage.",
"battery_falling": "When the battery drops faster than this in a day.",
"rebooted": "When the radio restarts.",
Expand Down Expand Up @@ -1506,7 +1509,7 @@
"alertReason": {
"observerNoData": "This observer does not report {{what}}.",
"repeatersOnly": "Only repeaters report {{what}}.",
"notPolled": "Beacon is not polling this repeater. Request telemetry for it first.",
"notPolled": "No telemetry is arriving for this repeater. Request telemetry for it first.",
"noData": "This repeater does not report {{what}}.",
"observerNoClock": "Observers have no clock drift value.",
"clockRepeatersOnly": "Only repeaters and room servers report their clock.",
Expand All @@ -1517,7 +1520,8 @@
"battery": "a battery level",
"uptime": "its uptime",
"temperature": "a temperature",
"noise": "a noise floor"
"noise": "a noise floor",
"telemetry": "telemetry"
},
"errors": {
"busy": "The server is busy. Try again in a moment.",
Expand Down Expand Up @@ -1736,6 +1740,8 @@
"telemetryAll": "Foreign source",
"telemetrySome": "Includes foreign readings",
"alsoReportedBy": "Also reported by",
"reportedBy": "Reported by",
"claimStale": "no current claim",
"alsoChecked": "Also checked by an outside observer",
"signed": "Signed",
"signedExplain": "This observer signs its polling announcements with its own key, and this site checked the signature. That confirms the announcement really came from this observer and wasn't changed on the way here.",
Expand All @@ -1754,6 +1760,34 @@
},
"foreignPollerChip": {
"label": "Foreign poller"
},
"localPoller": {
"label": "Local poller",
"tag": "Local",
"explain": "Runs in local mode: it polls repeaters its owner set up by hand and follows no server.",
"readingsUnit": "readings",
"note": "Local mode. This observer reports no claim, so slots and login state are not known.",
"sourceExplain": "Polled by an observer in local mode, set up by its owner. This server does not manage it.",
"footer": "Local mode",
"repeaters": "Repeaters",
"sourceAll": "Local source",
"sourceSome": "Includes local readings"
},
"sensors": {
"channel": "Channel {{n}}",
"humidity": "Humidity",
"pressure": "Pressure",
"gas": "Gas",
"airQuality": "Air quality",
"power": "Power",
"current": "Current",
"sensorVoltage": "Sensor voltage",
"distance": "Distance",
"moisture": "Moisture",
"light": "Light",
"calibrating": "Calibrating ({{n}}/3)",
"calibrated": "Calibrated (3/3)",
"accuracyHelp": "The sensor calibrates itself over hours to days and reports how far it has got, from 0 to 3. Below 3 the air quality index is an estimate and can still change a lot."
}
}
}
38 changes: 36 additions & 2 deletions assets/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,7 @@
"empty": "Les alertes se règlent sur les radios de votre Atlas. Ajoutez d'abord une radio.",
"requestAttention": "Vous êtes toujours prévenu quand une de vos demandes de télémétrie demande votre attention.",
"needsGoneQuiet": "Activez d'abord « {{name}} ».",
"goneQuietHint": "Un délai court peut donner de fausses alertes sur les radios entendues seulement par leurs annonces.",
"summaryNone": "Aucune alerte activée",
"summaryOnCount_one": "{{count}} alerte activée",
"summaryOnCount_many": "{{count}} alertes activées",
Expand All @@ -1480,6 +1481,7 @@
"kind": {
"gone_quiet": "Silence",
"back_online": "De retour",
"telemetry_stopped": "Télémétrie arrêtée",
"battery_low": "Batterie faible",
"battery_falling": "Batterie en baisse",
"rebooted": "Redémarrage",
Expand Down Expand Up @@ -1527,6 +1529,7 @@
"when": {
"gone_quiet": "Quand la radio n'a pas été entendue depuis ce délai.",
"back_online": "Quand la radio est de nouveau entendue après un silence.",
"telemetry_stopped": "Quand aucune télémétrie n'est arrivée depuis ce délai.",
"battery_low": "Quand la batterie reste sous cette tension.",
"battery_falling": "Quand la batterie baisse plus vite que cela en une journée.",
"rebooted": "Quand la radio redémarre.",
Expand Down Expand Up @@ -1555,7 +1558,7 @@
"alertReason": {
"observerNoData": "Cet observateur ne remonte pas {{what}}.",
"repeatersOnly": "Seuls les répéteurs remontent {{what}}.",
"notPolled": "Beacon ne sonde pas ce répéteur. Demandez d'abord sa télémétrie.",
"notPolled": "Aucune télémétrie n'arrive pour ce répéteur. Demandez d'abord sa télémétrie.",
"noData": "Ce répéteur ne remonte pas {{what}}.",
"observerNoClock": "Les observateurs n'ont pas de dérive d'horloge.",
"clockRepeatersOnly": "Seuls les répéteurs et les serveurs de salle remontent leur horloge.",
Expand All @@ -1566,7 +1569,8 @@
"battery": "le niveau de batterie",
"uptime": "la durée de fonctionnement",
"temperature": "la température",
"noise": "le niveau de bruit"
"noise": "le niveau de bruit",
"telemetry": "la télémétrie"
},
"errors": {
"busy": "Le serveur est occupé. Réessayez dans un instant.",
Expand Down Expand Up @@ -1787,6 +1791,8 @@
"telemetryAll": "Source externe",
"telemetrySome": "Inclut des relevés externes",
"alsoReportedBy": "Aussi signalé par",
"reportedBy": "Signalé par",
"claimStale": "aucune déclaration en cours",
"alsoChecked": "Aussi interrogé par un observateur extérieur",
"signed": "Signé",
"signedExplain": "Cet observateur signe ses annonces d'interrogation avec sa propre clé, et ce site a vérifié la signature. Cela confirme que l'annonce vient bien de cet observateur et n'a pas été modifiée en chemin.",
Expand All @@ -1805,6 +1811,34 @@
},
"foreignPollerChip": {
"label": "Interrogateur externe"
},
"localPoller": {
"label": "Interrogateur local",
"tag": "Local",
"explain": "Fonctionne en mode local : il interroge les répéteurs que son propriétaire a réglés à la main et ne suit aucun serveur.",
"readingsUnit": "mesures",
"note": "Mode local. Cet observateur n'envoie aucune déclaration, donc les places et l'état de connexion ne sont pas connus.",
"sourceExplain": "Interrogé par un observateur en mode local, réglé par son propriétaire. Ce serveur ne le gère pas.",
"footer": "Mode local",
"repeaters": "Répéteurs",
"sourceAll": "Source locale",
"sourceSome": "Inclut des mesures locales"
},
"sensors": {
"channel": "Canal {{n}}",
"humidity": "Humidité",
"pressure": "Pression",
"gas": "Gaz",
"airQuality": "Qualité de l’air",
"power": "Puissance",
"current": "Courant",
"sensorVoltage": "Tension du capteur",
"distance": "Distance",
"moisture": "Humidité du sol",
"light": "Luminosité",
"calibrating": "Calibrage en cours ({{n}}/3)",
"calibrated": "Calibré (3/3)",
"accuracyHelp": "Le capteur se calibre tout seul en quelques heures à quelques jours et indique où il en est, de 0 à 3. En dessous de 3, l’indice de qualité de l’air est une estimation et peut encore beaucoup changer."
}
}
}
38 changes: 36 additions & 2 deletions assets/locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,7 @@
"empty": "Aviseringar ställs in på radioapparater i din Atlas. Lägg först till en radio.",
"requestAttention": "Du får alltid besked när en av dina telemetribegäranden behöver uppmärksamhet.",
"needsGoneQuiet": "Slå först på {{name}}.",
"goneQuietHint": "Korta tider kan ge falsklarm för radior som bara hörs genom sina annonser.",
"summaryNone": "Inga larm på",
"summaryOnCount_one": "{{count}} larm på",
"summaryOnCount_other": "{{count}} larm på",
Expand All @@ -1431,6 +1432,7 @@
"kind": {
"gone_quiet": "Tystnat",
"back_online": "Tillbaka online",
"telemetry_stopped": "Telemetri upphört",
"battery_low": "Lågt batteri",
"battery_falling": "Fallande batteri",
"rebooted": "Startade om",
Expand Down Expand Up @@ -1478,6 +1480,7 @@
"when": {
"gone_quiet": "När radion inte har hörts på så här länge.",
"back_online": "När radion hörs igen efter att ha tystnat.",
"telemetry_stopped": "När ingen telemetri har kommit in på så här länge.",
"battery_low": "När batteriet stannar under den här spänningen.",
"battery_falling": "När batteriet sjunker snabbare än så här på ett dygn.",
"rebooted": "När radion startar om.",
Expand Down Expand Up @@ -1506,7 +1509,7 @@
"alertReason": {
"observerNoData": "Den här observatören rapporterar inte {{what}}.",
"repeatersOnly": "Bara repeatrar rapporterar {{what}}.",
"notPolled": "Beacon hämtar inte data från den här repeatern. Begär telemetri för den först.",
"notPolled": "Ingen telemetri kommer in för den här repeatern. Begär telemetri för den först.",
"noData": "Den här repeatern rapporterar inte {{what}}.",
"observerNoClock": "Observatörer har inget klockavvikelsevärde.",
"clockRepeatersOnly": "Bara repeatrar och rumsservrar rapporterar sin klocka.",
Expand All @@ -1517,7 +1520,8 @@
"battery": "batterinivå",
"uptime": "drifttid",
"temperature": "temperatur",
"noise": "brusnivå"
"noise": "brusnivå",
"telemetry": "telemetri"
},
"errors": {
"busy": "Servern är upptagen. Försök igen om en stund.",
Expand Down Expand Up @@ -1736,6 +1740,8 @@
"telemetryAll": "Extern källa",
"telemetrySome": "Innehåller externa mätvärden",
"alsoReportedBy": "Rapporteras även av",
"reportedBy": "Rapporteras av",
"claimStale": "inget aktuellt anspråk",
"alsoChecked": "Kontrolleras även av en utomstående observatör",
"signed": "Signerad",
"signedExplain": "Den här observatören signerar sina pollningsmeddelanden med sin egen nyckel, och den här sajten kontrollerade signaturen. Det bekräftar att meddelandet verkligen kom från den här observatören och inte ändrades på vägen hit.",
Expand All @@ -1754,6 +1760,34 @@
},
"foreignPollerChip": {
"label": "Extern pollare"
},
"localPoller": {
"label": "Lokal pollare",
"tag": "Lokal",
"explain": "Körs i lokalt läge: den avläser repeatrar som ägaren har ställt in för hand och följer ingen server.",
"readingsUnit": "mätvärden",
"note": "Lokalt läge. Den här observatören skickar inget anspråk, så platser och inloggningsstatus är inte kända.",
"sourceExplain": "Avläses av en observatör i lokalt läge, inställd av ägaren. Den här servern hanterar den inte.",
"footer": "Lokalt läge",
"repeaters": "Repeatrar",
"sourceAll": "Lokal källa",
"sourceSome": "Innehåller lokala mätvärden"
},
"sensors": {
"channel": "Kanal {{n}}",
"humidity": "Luftfuktighet",
"pressure": "Lufttryck",
"gas": "Gas",
"airQuality": "Luftkvalitet",
"power": "Effekt",
"current": "Ström",
"sensorVoltage": "Sensorspänning",
"distance": "Avstånd",
"moisture": "Markfuktighet",
"light": "Ljus",
"calibrating": "Kalibrerar ({{n}}/3)",
"calibrated": "Kalibrerad (3/3)",
"accuracyHelp": "Sensorn kalibrerar sig själv under timmar till dagar och anger hur långt den har kommit, från 0 till 3. Under 3 är luftkvalitetsindexet en uppskattning som fortfarande kan ändras mycket."
}
}
}
1 change: 1 addition & 0 deletions ios/NotificationService/BeaconPush.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ enum BeaconPush {
switch n.kind {
case "gone_quiet": return "\(name) has not been heard for \(plural(v, "hour"))."
case "back_online": return "\(name) is back online."
case "telemetry_stopped": return "\(name) has sent no telemetry for \(plural(v, "hour"))."
case "battery_low": return "\(name) battery is low: \(fixed(Double(v) / 1000, 2)) V."
case "battery_falling":
return "\(name) battery is falling by about \(fixed(Double(v) / 1000, 2)) V a day."
Expand Down
6 changes: 6 additions & 0 deletions lib/core/features.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class ServerFeatures {
this.atlasTelemetry = false,
this.atlasPoller = false,
this.atlas7d = false,
this.sensors = false,
this.mapTelemetry = false,
this.appDeviceLabel = false,
this.temperatureUnit = 'c',
Expand All @@ -31,6 +32,7 @@ class ServerFeatures {
atlasTelemetry = false,
atlasPoller = false,
atlas7d = false,
sensors = false,
mapTelemetry = false,
appDeviceLabel = false,
temperatureUnit = 'c',
Expand All @@ -55,6 +57,7 @@ class ServerFeatures {
atlasTelemetry: f['atlasTelemetry'] == true,
atlasPoller: f['atlasPoller'] == true,
atlas7d: f['atlas7d'] == true,
sensors: f['sensors'] == true,
mapTelemetry: f['mapTelemetry'] == true,
appDeviceLabel: f['appDeviceLabel'] == true,
temperatureUnit: d['temperatureUnit'] == 'f' ? 'f' : 'c',
Expand Down Expand Up @@ -85,6 +88,9 @@ class ServerFeatures {
/// The Atlas takes a 7 day range, and the account Atlas stores it.
final bool atlas7d;

/// Readings carry sensor channels, and the account Atlas stores sensor tiles.
final bool sensors;

/// Map labels may carry the latest telemetry; the toggle hides without it.
final bool mapTelemetry;

Expand Down
2 changes: 2 additions & 0 deletions lib/core/push_notice.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ String? alertSentence(PushNotice n) {
return '$name has not been heard for ${_plural(v, 'hour')}.';
case 'back_online':
return '$name is back online.';
case 'telemetry_stopped':
return '$name has sent no telemetry for ${_plural(v, 'hour')}.';
case 'battery_low':
return '$name battery is low: ${(v / 1000).toStringAsFixed(2)} V.';
case 'battery_falling':
Expand Down
12 changes: 6 additions & 6 deletions lib/features/account/alert_rule_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,7 @@ class _AlertRowState extends State<_AlertRow> {
bool get enabled => widget.rule?['enabled'] == true;
int? _stored(String field) => number(widget.rule?[field])?.toInt();

List<int> get options => widget.spec.input == AlertInput.hours
? goneQuietHours(
textOf(widget.target['kind']),
widget.target['polled'] == true,
)
: widget.spec.options;
List<int> get options => widget.spec.options;

@override
void initState() {
Expand Down Expand Up @@ -468,6 +463,11 @@ class _AlertRowState extends State<_AlertRow> {
),
const SizedBox(height: 10),
_input(),
if (kind == 'gone_quiet')
Padding(
padding: const EdgeInsets.only(top: 4),
child: Text(trKey('alerts.goneQuietHint'), style: muted),
),
if (enabled && rule != null)
Padding(
padding: const EdgeInsets.only(top: 4),
Expand Down
18 changes: 6 additions & 12 deletions lib/features/account/alert_rules.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ class AlertKindSpec {

/// The kinds in the order the rows are shown (the plan's table order).
const alertKinds = [
AlertKindSpec('gone_quiet', AlertInput.hours, [12, 24, 48]),
AlertKindSpec('gone_quiet', AlertInput.hours, quietHours),
AlertKindSpec('back_online', AlertInput.none),
AlertKindSpec('telemetry_stopped', AlertInput.hours, quietHours),
AlertKindSpec('battery_low', AlertInput.volts),
AlertKindSpec('battery_falling', AlertInput.drop, [100, 200, 300]),
AlertKindSpec('rebooted', AlertInput.none),
Expand All @@ -29,20 +30,12 @@ const alertKinds = [
AlertKindSpec('observer_offline', AlertInput.minutes, [30, 60, 180, 360]),
];

/// Gone quiet also offers 3 and 6 hours for observers and polled repeaters;
/// `polled` is the server's own answer for the radio.
List<int> goneQuietHours(String targetKind, bool polled) {
final short = targetKind == 'observer' || polled;
return [
if (short) ...[3, 6],
12,
24,
48,
];
}
/// The hours gone_quiet and telemetry_stopped take, on every radio.
const quietHours = [3, 6, 12, 24, 48];

const defaultThreshold = {
'gone_quiet': 24,
'telemetry_stopped': 12,
'battery_low': 3500,
'battery_falling': 200,
'noise_high': -90,
Expand Down Expand Up @@ -137,6 +130,7 @@ const _what = {
'rebooted': 'uptime',
'temperature': 'temperature',
'noise_high': 'noise',
'telemetry_stopped': 'telemetry',
};

/// Why a kind is unavailable, in the user's language, read from the code. No
Expand Down
Loading