Skip to content

Commit

Permalink
Add deprecation warnings for outdated protocols (#105)
Browse files Browse the repository at this point in the history
As of 11 days ago, Ruuvi marked older protocols as obsolete or deprecated.
  • Loading branch information
Sérgio committed Apr 11, 2020
1 parent 7120b6f commit 3dac6fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ruuvitag_sensor/decoder.py
Expand Up @@ -17,10 +17,16 @@ def get_decoder(data_type):
object: Data decoder
"""
if data_type == 2:
log.warning("DATA TYPE 2 IS OBSOLETE. UPDATE YOUR TAG")
# https://github.com/ruuvi/ruuvi-sensor-protocols/blob/master/dataformat_04.md
return UrlDecoder()
if data_type == 4:
log.warning("DATA TYPE 4 IS OBSOLETE. UPDATE YOUR TAG")
# https://github.com/ruuvi/ruuvi-sensor-protocols/blob/master/dataformat_04.md
return UrlDecoder()
if data_type == 3:
log.warning("DATA TYPE 3 IS DEPRECATED - UPDATE YOUR TAG")
# https://github.com/ruuvi/ruuvi-sensor-protocols/blob/master/dataformat_03.md
return Df3Decoder()
return Df5Decoder()

Expand Down

0 comments on commit 3dac6fc

Please sign in to comment.