1212from aioasuswrt .asuswrt import AsusWrt as AsusWrtLegacy
1313from aiohttp import ClientSession
1414from asusrouter import AsusRouter , AsusRouterError
15+ from asusrouter .config import ARConfigKey
1516from asusrouter .modules .client import AsusClient
1617from asusrouter .modules .data import AsusData
1718from asusrouter .modules .homeassistant import convert_to_ha_data , convert_to_ha_sensors
@@ -314,10 +315,14 @@ class AsusWrtHttpBridge(AsusWrtBridge):
314315 def __init__ (self , conf : dict [str , Any ], session : ClientSession ) -> None :
315316 """Initialize Bridge that use HTTP library."""
316317 super ().__init__ (conf [CONF_HOST ])
317- self ._api = self ._get_api (conf , session )
318+ # Get API configuration
319+ config = self ._get_api_config ()
320+ self ._api = self ._get_api (conf , session , config )
318321
319322 @staticmethod
320- def _get_api (conf : dict [str , Any ], session : ClientSession ) -> AsusRouter :
323+ def _get_api (
324+ conf : dict [str , Any ], session : ClientSession , config : dict [ARConfigKey , Any ]
325+ ) -> AsusRouter :
321326 """Get the AsusRouter API."""
322327 return AsusRouter (
323328 hostname = conf [CONF_HOST ],
@@ -326,8 +331,19 @@ def _get_api(conf: dict[str, Any], session: ClientSession) -> AsusRouter:
326331 use_ssl = conf [CONF_PROTOCOL ] == PROTOCOL_HTTPS ,
327332 port = conf .get (CONF_PORT ),
328333 session = session ,
334+ config = config ,
329335 )
330336
337+ def _get_api_config (self ) -> dict [ARConfigKey , Any ]:
338+ """Get configuration for the API."""
339+ return {
340+ # Enable automatic temperature data correction in the library
341+ ARConfigKey .OPTIMISTIC_TEMPERATURE : True ,
342+ # Disable `warning`-level log message when temperature
343+ # is corrected by setting it to already notified.
344+ ARConfigKey .NOTIFIED_OPTIMISTIC_TEMPERATURE : True ,
345+ }
346+
331347 @property
332348 def is_connected (self ) -> bool :
333349 """Get connected status."""
0 commit comments