@@ -102,34 +102,30 @@ async def get_status(client: httpx.AsyncClient, device: str) -> Status:
102102 try :
103103 content = BeautifulSoup (response .text , features = "html.parser" )
104104 container = cast (Tag , content .find (class_ = "container" ))
105- temperature_raw = cast (
106- PageElement , cast (Tag , container .find_all (class_ = "col-12" )[1 ]).find (class_ = "bigText" )
107- ).text
105+ temperature_raw = cast (PageElement , container .find_all (class_ = "col-12" )[1 ].find (class_ = "bigText" )).text
108106 in_data , _ , temp_out = temperature_raw .strip ().partition ("%" )
109107 temp_in , _ , humi_in = in_data .strip ().partition ("/" )
110- mode_raw = cast (PageElement , cast ( Tag , container .find_all (class_ = "col-12" )[3 ]) .find ("span" )).text
111- co2_raw = cast (PageElement , cast ( Tag , container .find_all (class_ = "col-12" )[4 ]) .find ("b" )).text
108+ mode_raw = cast (PageElement , container .find_all (class_ = "col-12" )[3 ].find ("span" )).text
109+ co2_raw = cast (PageElement , container .find_all (class_ = "col-12" )[4 ].find ("b" )).text
112110 filter_raw = (
113111 cast (
114112 str ,
115- cast (Tag , cast ( Tag , container .find_all (class_ = "filterBox" )[1 ]) .div )["style" ],
113+ cast (Tag , container .find_all (class_ = "filterBox" )[1 ].div )["style" ],
116114 )
117115 .partition (":" )[2 ]
118116 .partition ("%" )[0 ]
119117 )
120118 fan_raw = (
121119 cast (
122120 str ,
123- cast (Tag , cast ( Tag , container .find_all (class_ = "filterBox" )[2 ]) .div )["style" ],
121+ cast (Tag , container .find_all (class_ = "filterBox" )[2 ].div )["style" ],
124122 )
125123 .partition (":" )[2 ]
126124 .partition ("%" )[0 ]
127125 )
128126 light_raw = cast (str , cast (Tag , container .find (id = "myRange" ))["value" ])
129- warnings_wrapper = cast (Tag , cast (Tag , container .find (id = "errorModal" )).find_all (class_ = "modalText" )[0 ])
130- warnings = [
131- cast (str , cast (Tag , d ).find (string = True )) for d in warnings_wrapper .find_all ("div" , recursive = False )[1 :]
132- ]
127+ warnings_wrapper = cast (Tag , container .find (id = "errorModal" )).find_all (class_ = "modalText" )[0 ]
128+ warnings = [cast (str , d .find (string = True )) for d in warnings_wrapper .find_all ("div" , recursive = False )[1 :]]
133129
134130 return Status (
135131 device = device ,
0 commit comments