Skip to content

Commit

Permalink
hddtemp: remove deprecated telnetlib dependency (fixes ultrabug#2261)
Browse files Browse the repository at this point in the history
  • Loading branch information
valdur55 committed Oct 10, 2024
1 parent 2609acf commit 48688e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions py3status/modules/hddtemp.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
Requires:
hddtemp: utility to monitor hard drive temperatures
netcat: (nc) is a command-line utility for reading
data from hddtemp telnet interface
Bible of HDD failures:
Hard disk temperatures higher than 45°C led to higher failure rates.
Expand Down Expand Up @@ -108,7 +110,6 @@
"""

from string import printable
from telnetlib import Telnet


class Py3status:
Expand All @@ -135,7 +136,7 @@ def post_config_hook(self):
self.thresholds_init = self.py3.get_color_names_list(self.format_hdd)

def hddtemp(self):
line = Telnet("localhost", 7634).read_all().decode("utf-8", "ignore")
line = self.py3.command_output("nc localhost 7634")
new_data = []

for chunk in line[1:-1].split("||"):
Expand Down

0 comments on commit 48688e6

Please sign in to comment.