| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0eec4db commit b32d330
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -725,15 +725,6 @@ async def get_smart_test_calls(protocol: SmartProtocol): | |||
| 725 | 725 | successes = [] | |
| 726 | 726 | child_device_components = {} | |
| 727 | 727 | ||
| 728 | - extra_test_calls = [ | ||
| 729 | - SmartCall( | ||
| 730 | - module="temp_humidity_records", | ||
| 731 | - request=SmartRequest.get_raw_request("get_temp_humidity_records").to_dict(), | ||
| 732 | - should_succeed=False, | ||
| 733 | - child_device_id="", | ||
| 734 | - ), | ||
| 735 | - ] | ||
| 736 | - | ||
| 737 | 728 | click.echo("Testing component_nego call ..", nl=False) | |
| 738 | 729 | responses = await _make_requests_or_exit( | |
| 739 | 730 | protocol, | |
@@ -812,8 +803,6 @@ async def get_smart_test_calls(protocol: SmartProtocol): | |||
| 812 | 803 | click.echo(f"Skipping {component_id}..", nl=False) | |
| 813 | 804 | click.echo(click.style("UNSUPPORTED", fg="yellow")) | |
| 814 | 805 | ||
| 815 | - test_calls.extend(extra_test_calls) | ||
| 816 | - | ||
| 817 | 806 | # Child component calls | |
| 818 | 807 | for child_device_id, child_components in child_device_components.items(): | |
| 819 | 808 | test_calls.append( | |
@@ -839,12 +828,6 @@ async def get_smart_test_calls(protocol: SmartProtocol): | |||
| 839 | 828 | else: | |
| 840 | 829 | click.echo(f"Skipping {component_id}..", nl=False) | |
| 841 | 830 | click.echo(click.style("UNSUPPORTED", fg="yellow")) | |
| 842 | - # Add the extra calls for each child | ||
| 843 | - for extra_call in extra_test_calls: | ||
| 844 | - extra_child_call = dataclasses.replace( | ||
| 845 | - extra_call, child_device_id=child_device_id | ||
| 846 | - ) | ||
| 847 | - test_calls.append(extra_child_call) | ||
| 848 | 831 | ||
| 849 | 832 | return test_calls, successes | |
| 850 | 833 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -425,6 +425,7 @@ def get_component_requests(component_id, ver_code): | |||
| 425 | 425 | "get_trigger_logs", SmartRequest.GetTriggerLogsParams() | |
| 426 | 426 | ) | |
| 427 | 427 | ], | |
| 428 | + "temp_humidity_record": [SmartRequest.get_raw_request("get_temp_humidity_records")], | ||
| 428 | 429 | "double_click": [SmartRequest.get_raw_request("get_double_click_info")], | |
| 429 | 430 | "child_device": [ | |
| 430 | 431 | SmartRequest.get_raw_request("get_child_device_list"), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,7 +48,7 @@ async def state(ctx, dev: Device): | |||
| 48 | 48 | ) | |
| 49 | 49 | echo( | |
| 50 | 50 | f"Firmware: {dev.device_info.firmware_version}" | |
| 51 | - f" {dev.device_info.firmware_build}" | ||
| 51 | + f"{' ' + build if (build := dev.device_info.firmware_build) else ''}" | ||
| 52 | 52 | ) | |
| 53 | 53 | echo(f"MAC (rssi): {dev.mac} ({dev.rssi})") | |
| 54 | 54 | if verbose: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -161,7 +161,7 @@ class DeviceInfo: | |||
| 161 | 161 | device_type: DeviceType | |
| 162 | 162 | hardware_version: str | |
| 163 | 163 | firmware_version: str | |
| 164 | - firmware_build: str | ||
| 164 | + firmware_build: str | None | ||
| 165 | 165 | requires_auth: bool | |
| 166 | 166 | region: str | None | |
| 167 | 167 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -760,7 +760,10 @@ def _get_device_info( | |||
| 760 | 760 | device_family = sys_info.get("type", sys_info.get("mic_type")) | |
| 761 | 761 | device_type = IotDevice._get_device_type_from_sys_info(info) | |
| 762 | 762 | fw_version_full = sys_info["sw_ver"] | |
| 763 | - firmware_version, firmware_build = fw_version_full.split(" ", maxsplit=1) | ||
| 763 | + if " " in fw_version_full: | ||
| 764 | + firmware_version, firmware_build = fw_version_full.split(" ", maxsplit=1) | ||
| 765 | + else: | ||
| 766 | + firmware_version, firmware_build = fw_version_full, None | ||
| 764 | 767 | auth = bool(discovery_info and ("mgt_encrypt_schm" in discovery_info)) | |
| 765 | 768 | ||
| 766 | 769 | return DeviceInfo( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -913,7 +913,10 @@ def _get_device_info( | |||
| 913 | 913 | components, device_family | |
| 914 | 914 | ) | |
| 915 | 915 | fw_version_full = di["fw_ver"] | |
| 916 | - firmware_version, firmware_build = fw_version_full.split(" ", maxsplit=1) | ||
| 916 | + if " " in fw_version_full: | ||
| 917 | + firmware_version, firmware_build = fw_version_full.split(" ", maxsplit=1) | ||
| 918 | + else: | ||
| 919 | + firmware_version, firmware_build = fw_version_full, None | ||
| 917 | 920 | _protocol, devicetype = device_family.split(".") | |
| 918 | 921 | # Brand inferred from SMART.KASAPLUG/SMART.TAPOPLUG etc. | |
| 919 | 922 | brand = devicetype[:4].lower() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -103,7 +103,10 @@ def _get_device_info( | |||
| 103 | 103 | model = cifp["device_model"] | |
| 104 | 104 | device_type = SmartCamDevice._get_device_type_from_sysinfo(cifp) | |
| 105 | 105 | fw_version_full = cifp["sw_ver"] | |
| 106 | - firmware_version, firmware_build = fw_version_full.split(" ", maxsplit=1) | ||
| 106 | + if " " in fw_version_full: | ||
| 107 | + firmware_version, firmware_build = fw_version_full.split(" ", maxsplit=1) | ||
| 108 | + else: | ||
| 109 | + firmware_version, firmware_build = fw_version_full, None | ||
| 107 | 110 | return DeviceInfo( | |
| 108 | 111 | short_name=model, | |
| 109 | 112 | long_name=model, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,7 +47,10 @@ def _get_device_info( | |||
| 47 | 47 | long_name = discovery_info["device_model"] if discovery_info else short_name | |
| 48 | 48 | device_type = SmartCamDevice._get_device_type_from_sysinfo(basic_info) | |
| 49 | 49 | fw_version_full = basic_info["sw_version"] | |
| 50 | - firmware_version, firmware_build = fw_version_full.split(" ", maxsplit=1) | ||
| 50 | + if " " in fw_version_full: | ||
| 51 | + firmware_version, firmware_build = fw_version_full.split(" ", maxsplit=1) | ||
| 52 | + else: | ||
| 53 | + firmware_version, firmware_build = fw_version_full, None | ||
| 51 | 54 | return DeviceInfo( | |
| 52 | 55 | short_name=basic_info["device_model"], | |
| 53 | 56 | long_name=long_name, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments