From 2d60404b1964edd5c47ca813e831141fb485f3a1 Mon Sep 17 00:00:00 2001 From: josep Date: Wed, 18 Dec 2024 19:40:28 +0900 Subject: [PATCH] =?UTF-8?q?=ED=99=98=EA=B2=BD=20=EB=AA=A8=EB=93=88=20?= =?UTF-8?q?=EC=A1=B0=EB=8F=84=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/basic_usage_examples/env_example.py | 2 +- modi_plus/module/input_module/env.py | 6 +++--- modi_plus/util/inspection_util.py | 4 ++-- modi_plus/util/usage_util.py | 2 +- tests/module/input_module/test_env.py | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/basic_usage_examples/env_example.py b/examples/basic_usage_examples/env_example.py index 20e8563..866f207 100644 --- a/examples/basic_usage_examples/env_example.py +++ b/examples/basic_usage_examples/env_example.py @@ -12,5 +12,5 @@ while True: print(f"humidity(%): {env.humidity:<10} temperature(°C): {env.temperature:<10} " - f"intensity(%): {env.intensity:<10} Volume(%): {env.volume:<10}", end="\r") + f"illuminance(%): {env.illuminance:<10} Volume(%): {env.volume:<10}", end="\r") time.sleep(0.02) diff --git a/modi_plus/module/input_module/env.py b/modi_plus/module/input_module/env.py index 90711e1..8eb16b2 100644 --- a/modi_plus/module/input_module/env.py +++ b/modi_plus/module/input_module/env.py @@ -14,10 +14,10 @@ class Env(InputModule): PROPERTY_OFFSET_VOLUME = 6 @property - def intensity(self) -> int: - """Returns the value of intensity between 0 and 100 + def illuminance(self) -> int: + """Returns the value of illuminance between 0 and 100 - :return: The environment's intensity. + :return: The environment's illuminance. :rtype: int """ diff --git a/modi_plus/util/inspection_util.py b/modi_plus/util/inspection_util.py index e18d8f1..ed6b4ea 100644 --- a/modi_plus/util/inspection_util.py +++ b/modi_plus/util/inspection_util.py @@ -106,13 +106,13 @@ def inspect_battery(self, module, i, nb_modules): def inspect_env(self, module, i, nb_modules): self.print_wrap( """ - Environment module has intensity, temperature, humidity and volume as its property. + Environment module has illuminance, temperature, humidity and volume as its property. """ ) input("\nIf you are ready to inspect this module, Press ENTER: ") self.clear() - properties = ["intensity", "temperature", "humidity", "volume"] + properties = ["illuminance", "temperature", "humidity", "volume"] for prop in properties: self.print_module_page(module, i, nb_modules) diff --git a/modi_plus/util/usage_util.py b/modi_plus/util/usage_util.py index 814c37a..f3b21a2 100644 --- a/modi_plus/util/usage_util.py +++ b/modi_plus/util/usage_util.py @@ -135,7 +135,7 @@ def run_env_manual(self): env = bundle.envs[0] while True: - print(f"Env ({env.id}) intensity: {env.intensity}") + print(f"Env ({env.id}) illuminance: {env.illuminance}") print(f"Env ({env.id}) temperature: {env.temperature}") print(f"Env ({env.id}) humidity: {env.humidity}") print(f"Env ({env.id}) volume: {env.volume}") diff --git a/tests/module/input_module/test_env.py b/tests/module/input_module/test_env.py index 811ba8b..14a7369 100644 --- a/tests/module/input_module/test_env.py +++ b/tests/module/input_module/test_env.py @@ -40,10 +40,10 @@ def test_get_humidity(self): ) self.assertEqual(_, 0) - def test_get_intensity(self): - """Test get_intensity method.""" + def test_get_illuminance(self): + """Test get_illuminance method.""" - _ = self.env.intensity + _ = self.env.illuminance self.assertEqual( self.connection.send_list[0], parse_get_property_message(-1, Env.PROPERTY_ENV_STATE, self.env.prop_samp_freq)