diff --git a/CHANGELOG.md b/CHANGELOG.md index b7c6b40..74396bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 _Changes in the next release_ +### Fixed +- Environment variable `UC_INTEGRATION_HTTP_PORT` to override server port. + --- ## v0.1.2 - 2023-11-07 diff --git a/ucapi/api.py b/ucapi/api.py index 4318b49..d6ac2fc 100644 --- a/ucapi/api.py +++ b/ucapi/api.py @@ -82,11 +82,10 @@ async def init( # publishing interface, defaults to "0.0.0.0" if not set interface = os.getenv("UC_INTEGRATION_INTERFACE") - port = int( - os.getenv("UC_INTEGRATION_HTTP_PORT") or self._driver_info["port"] - if "port" in self._driver_info - else 9090 - ) + if os.getenv("UC_INTEGRATION_HTTP_PORT"): + port = int(os.getenv("UC_INTEGRATION_HTTP_PORT")) + else: + port = self._driver_info["port"] if "port" in self._driver_info else 9090 _adjust_driver_url(self._driver_info, port)