Skip to content

Commit

Permalink
Effectuez également la conversion C/F pour d'autres protos WS
Browse files Browse the repository at this point in the history
  • Loading branch information
KaliStudio committed Feb 24, 2024
1 parent 50591d3 commit 6f63a5c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/subghz/protocols/oregon_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,19 +306,22 @@ SubGhzProtocolStatus
void ws_protocol_decoder_oregon_v1_get_string(void* context, FuriString* output) {
furi_assert(context);
WSProtocolDecoderOregon_V1* instance = context;
bool locale_is_metric = furi_hal_rtc_get_locale_units() == FuriHalRtcLocaleUnitsMetric;
furi_string_cat_printf(
output,
"%s\r\n%dbit\r\n"
"Key:0x%lX%08lX\r\n"
"Sn:0x%lX Ch:%d Bat:%d\r\n"
"Temp:%3.1f C Hum:%d%%",
"Temp:%3.1f %c Hum:%d%%",
instance->generic.protocol_name,
instance->generic.data_count_bit,
(uint32_t)(instance->generic.data >> 32),
(uint32_t)(instance->generic.data),
instance->generic.id,
instance->generic.channel,
instance->generic.battery_low,
(double)instance->generic.temp,
(double)(locale_is_metric ? instance->generic.temp :
locale_celsius_to_fahrenheit(instance->generic.temp)),
locale_is_metric ? 'C' : 'F',
instance->generic.humidity);
}

0 comments on commit 6f63a5c

Please sign in to comment.