albertogeniola / MerossIot

Async Python library for controlling Meross devices
https://albertogeniola.github.io/MerossIot/
MIT License
486 stars 89 forks source link

Project dependencies may have API risk issues #256

Closed PyDeps closed 1 year ago

PyDeps commented 2 years ago

Hi, In MerossIot, inappropriate dependency versioning constraints can cause risks.

Below are the dependencies and version constraints that the project is using

paho-mqtt>=1.5.0
requests>=2.19.1
aiohttp[speedups]>=3.7.4.post0

The version constraint == will introduce the risk of dependency conflicts because the scope of dependencies is too strict. The version constraint No Upper Bound and * will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs.

After further analysis, in this project, The version constraint of dependency aiohttp can be changed to >=0.18.0,<=4.0.0a1.

The above modification suggestions can reduce the dependency conflicts as much as possible, and introduce the latest version as much as possible without calling Error in the projects.

The invocation of the current project includes all the following methods.

The calling methods from the aiohttp
aiohttp.ClientSession
The calling methods from the all methods
self.__mode.get
self.async_turn_off
HttpStat
self._build_mqtt_message
isinstance
hub_subparsers.add_parser.set_defaults
MerossHttpClient._async_authenticated_post
f.cancel
self._loop.create_future
time.isoformat
asyncio.get_event_loop.run_until_complete
self._new_mqtt_client
meross_iot.model.enums.ThermostatV3Mode
dev.async_get_instant_metrics
self.__samples.append
time_window.total_seconds
logging.getLogger.info
meross_iot.model.exception.UnknownDeviceType
self._push_coros.append
asyncio.iscoroutinefunction
_camel_to_underscore
datetime.datetime.utcnow.timestamp
zipfile.ZipFile.write
self.async_execute_cmd
self.__temperature.get
logging.getLogger.getChild.exception
self._devices_by_internal_id.get.dismiss
self.__humidity.get
dev.async_get_temperature
zipfile.ZipFile.close
json_dict.items
self.issued_on.isoformat
self.connect_event.wait
x.group.upper
self._by_method_namespace.items
asyncio.run_coroutine_threadsafe.add_done_callback
f.cancelled
d.get
target_clazz
dev.async_turn_on
email.strip.strip
platform.system
meross_iot.model.credentials.MerossCloudCreds.from_json.to_json
meross_iot.model.enums.ThermostatMode
meross_iot.utilities.misc.current_version
asyncio.run_coroutine_threadsafe.set_exception
d.copy
round
setuptools.setup
self._convert_rgb
next
self._state.get
subparsers.add_parser.add_subparsers
parser.add_subparsers.add_parser
self._async_get_create_mqtt_client.connect
meross_iot.utilities.network.extract_port
meross_iot.model.push.factory.parse_push_notification
self.async_handle_subdevice_notification
address.split
logging.Formatter
exit
uuid.uuid4.encode
format
argparse.ArgumentParser.add_subparsers
_build_cached_type
self.__mode.update
self._http_client.async_list_devices
join.encode
self._shutter__position_by_channel.get
meross_iot.model.http.exception.HttpApiError
datatosign.encode
list.append
datetime.datetime.fromisoformat
hashlib.md5
self._error_budget_manager.is_out_of_budget
self.abilities.get
self._mqtt_clients.items
float
from_topic.split
self._device_registry.relinquish_device
input
getattr.update
self._by_http_response_code.items
subdev_state.get
tuple
channel.self._shutter__config_by_channel.get.get
self._async_get_create_mqtt_client
super.async_turn_on
min
enumerate
datetime.datetime.fromtimestamp
self._parse_channels
super.async_handle_update
ApiStat.add
os.environ.get
enrolled_subdevices.append
self._async_get_create_mqtt_client.user_data_set
subdevtype
self._mqtt_client.loop_start
response.json.get
self.connect_event.set
self._channel_light_status.get
hub.get_subdevice
self._hub._execute_command.copy
logging.basicConfig
meross_iot.model.http.exception.AuthenticatedPostException
cls
k.split
DeviceSniffer.start
self._hub._execute_command
livereload.Server.serve
ApiStatsResult
self._async_dispatch_push_notification
http_api_client.cloud_credentials.to_json
hasattr
self.async_handle_update
meross_iot.model.enums.RollerShutterState
logging.getLogger.exception
meross_iot.model.http.exception.TokenExpiredException
data.get.get.get
self._async_handle_push_notification_post_dispatching
self._channel_toggle_status.get
cls._async_log
asyncio.get_event_loop
creds.to_json.encode
set
random.randint
device_subparsers.add_parser.set_defaults
push_notification_class
meross_iot.manager.MerossManager.async_init
hub.register_subdevice
self.__adjust.update
join
platform.version
self._by_url.items
self.__humidity.update
meross_iot.manager.MerossManager
self.__temperature.update
self.last_sampled_time.timestamp
self._mqtt_clients.values
self._notify_connection_drop
message_hash.hexdigest.lower
c
self._channel_spray_status.get
logging.getLogger
self.api_calls.append
self._by_uuid.items
_generate_nonce
subparsers.add_parser.add_argument
self.__PUSH_MAP.get
_KNOWN_DEV_TYPES_CLASSES.get
meross_iot.http_api.MerossHttpClient.async_from_user_password.async_list_devices
self._async_get_create_mqtt_client.loop_start
self._async_send_and_wait_ack.get
os.path.join
logging.FileHandler
DeviceSniffer
self.get_light_is_on
self.find_devices.get
parser_hub.add_subparsers.add_parser
ThermostatState
md5_hash.hexdigest.lower
dev.async_update
logging.getLogger.error
self._async_get_create_mqtt_client.tls_set
getpass.getpass
MerossHttpClient.async_from_cloud_creds
list.add
ApiCallSample
HttpStat.add
main
typing.TypeVar
ApiStat
aiohttp.ClientSession
meross_iot.utilities.mqtt.build_client_response_topic
self.async_device_discovery
self.__channel_cached_samples.get
meross_iot.http_api.MerossHttpClient.async_from_user_password
data.get.get.get.get
self._mqtt_client.username_pw_set
cls.async_login
self._async_get_create_mqtt_client.publish
self._supports_mode
len
zipfile.ZipFile
self._thermostat_state_by_channel.get
_caclulate_device_type_name
json.loads.get
meross_iot.model.push.online.OnlinePushNotification
execute
meross_iot.error_budget.ErrorBudgetManager
meross_iot.device_factory.build_meross_device_from_abilities
self.__togglex.update
self._door_open_state_by_channel.get
system.get.get
payload.copy
dev.get_status
self._async_get_create_mqtt_client.proxy_set
self._mqtt_client.tls_set
dev.get_supports_rgb
json.loads
response.json
MerossCloudCreds
self._mqtt_client.disconnect
dev.async_set_light_color
self._async_send_and_wait_ack.json
super
m
auth_subparsers.add_parser.add_argument
dev.is_on
self._get_stats
self._align_temp
self._devices_by_internal_id.values
meross_iot.utilities.conversion.rgb_to_int
meross_iot.manager.MerossManager.close
self.raw_data.get
asyncio.Event
open
os.getenv
val.get
os.path.abspath
dev.get_rgb_color
self._sub_devices.get
data.get.get
asyncio.WindowsSelectorEventLoopPolicy
self._async_enroll_new_http_subdev
self._get_update_budget_window
self._get_client_from_domain_port
logging.getLogger.getChild.setLevel
logging.getLogger.setLevel
self._execute_command.get
self._async_get_create_mqtt_client.reconnect
meross_iot.utilities.mqtt.build_device_request_topic
type
meross_iot.model.enums.DNDMode
self._shutter__state_by_channel.get
cls._async_authenticated_post
meross_iot.model.exception.CommandTimeoutError
meross_iot.model.enums.Namespace.CONTROL_LIGHT.value.self.abilities.get.get
self._devices_by_internal_id.get
Namespace
meross_iot.model.plugin.hub.BatteryInfo
datetime.datetime.utcnow
setuptools.find_packages
base64.b64decode
x.get
asyncio.get_event_loop.close
device_abilities.items
platform.machine
self.__togglex.get
json.dumps
hubs.append
self._devices_by_internal_id.get.async_handle_push_notification
selected_device.get_mqtt_port
self._handle_and_dispatch_push_notification
random.SystemRandom
DeviceRegistry
self._shutter__config_by_channel.get
self._mqtt_client.loop_stop
_main
meross_iot.model.http.exception.TooManyTokensException
self._device_registry.lookup_base_by_uuid.update_from_http_state
self._async_operate
sorted
dev.get_is_open
NotImplementedError
manager.find_devices
sys.stdout.getpass.getpass.strip
pkg_resources.get_distribution
self.find_devices
meross_iot.model.http.exception.BadLoginException
self._push_coros.remove
meross_iot.model.plugin.power.PowerInfo.get
meross_iot.utilities.network.extract_domain
http_device_info.to_dict
ChannelInfo
asyncio.run_coroutine_threadsafe.cancelled
handler
_lookup_cached_type
device_abilities.get
json.dumps.encode
dev.async_open
meross_iot.model.plugin.power.PowerInfo
meross_iot.model.push.generic.GenericPushNotification
self._async_execute_cmd_http
h.async_update
_schedule_later
ApiStatsResult.add
logging.getLogger.getChild.debug
hashlib.md5.update
self.check_full_update_done
random.randrange
self._sub_devices.values
super.__init__
logging.getLogger.getChild.addHandler
self.raw_data.get.get
self.get_supported_presets
datetime.timedelta
self._device_registry.find_all_by
asyncio.sleep
self._by_url.get
datetime.datetime.strptime
meross_iot.model.http.error_codes.ErrorCodes
kwargs.get
meross_iot.utilities.mqtt.generate_client_and_app_id
logging.FileHandler.setFormatter
_update_devices_after_reconnection
parser_device.add_subparsers.add_parser
self._mqtt_client.connect
self.subscribe_event.set
filter
base64.b64encode
logging.getLogger.warning
enrolled_devices.append
meross_iot.utilities.mqtt.verify_message_signature
parser_auth.add_subparsers.add_parser
http_device_info.device_type.lower
self._global.add
livereload.Server.watch
getattr.hexdigest
threading.Event
meross_iot.manager.MerossManager.async_execute_cmd
self.vars.items
already_known_http_devices.items
meross_iot.model.credentials.MerossCloudCreds.from_json
self._async_get_create_mqtt_client.username_pw_set
method.upper
argparse.ArgumentParser
self._async_enroll_new_http_dev
self._execute_command
uuid.uuid4
Exception
stats_counter.notify_http_request
_SUBDEVICE_MAPPING.get
self._fire_push_notification_event
self.get_subdevice
iargs.__dict__.items
meross_iot.manager.MerossManager.find_devices
super.async_handle_push_notification
self._async_get_create_mqtt_client.is_connected
self._update_mode
self._http_client.async_list_hub_subdevices
self._mqtt_connected_and_subscribed.get.clear
meross_iot.device_factory.build_meross_device_from_known_types
re.compile.sub
meross_iot.model.exception.CommandError
str
x.group
ValueError
self._mqtt_connected_and_subscribed.get.wait
n.get
self.async_set_light_color
datetime.datetime.utcfromtimestamp
self._device_registry.lookup_base_by_uuid
header.get
data.get
func
x.isoformat
self._manager.async_execute_cmd
os.path.dirname
sys.path.insert
self._channel_togglex_status.get
self._async_get_create_mqtt_client.tls_insecure_set
_PENDING_FUTURES.remove
firmware_version.hardware_version.device_type._caclulate_device_type_name.strip
ErrorBudget
HttpRequestSample
clearpwd.encode
self._async_get_create_mqtt_client.disconnect
meross_iot.utilities.mqtt.generate_mqtt_password
list
dev.async_turn_off
self.dropped_calls.append
discovered_new_http_devices.append
meross_iot.http_api.MerossHttpClient.async_from_user_password.async_logout
strtohash.encode
self._devices_budget.get
meross_iot.model.plugin.light.LightInfo.update
self._mqtt_client.subscribe
self.subscribe_event.clear
print
unauthenticated_command_executor
dev.async_stop
paho.mqtt.client.Client
meross_iot.model.plugin.light.LightInfo
int.strip
light_payload.update
asyncio.run_coroutine_threadsafe.set_result
DeviceSniffer.stop
self._prepare_push_notification_data.get
self._by_uuid.get
self._pending_messages_futures.get
result.get.get
self._samples.append
_underscore_to_camel
meross_iot.model.enums.get_or_parse_namespace
meross_iot.model.enums.SprayMode
x.group.lower
livereload.shell
_PUSH_NOTIFICATION_BINDING.get
reversed
session.post
self._get_default_channel_index
self.__samples.clear
self.to_json
meross_iot.device_factory.build_meross_subdevice
HttpStatsResult
super.async_turn_off
self._device_registry.enroll_device
meross_iot.model.http.device.HttpDeviceInfo.from_dict
dev.async_close
int
dev.get_position
url.lower
headers.copy
self.__adjust.get
_PENDING_FUTURES.append
self._async_get_create_mqtt_client.subscribe
self._mqtt_connected_and_subscribed.get
meross_iot.utilities.stats.HttpStatsCounter
meross_iot.utilities.mqtt.build_client_user_topic
data.copy.pop
meross_iot.utilities.conversion.int_to_rgb
self.async_execute_cmd_client
_mqtt_key_from_domain_port
f.read
self._thermostat_state_by_channel.get.update
asyncio.run_coroutine_threadsafe.done
_dynamic_types.get
selected_device.get_mqtt_host
self._mqtt_clients.get
self._update_and_send_push
meross_iot.model.push.common.TimeInfo.from_dict
self.subscribe_event.wait
getattr
self._state.update
logging.getLogger.getChild.info
meross_iot.model.http.subdevice.HttpSubdeviceInfo.from_dict
self._prepare_push_notification_data
meross_iot.model.credentials.MerossCloudCreds
argparse.ArgumentParser.parse_args
hashlib.md5.hexdigest
super.async_update
logging.getLogger.debug
random.SystemRandom.choice
meross_iot.manager.MerossManager.async_device_discovery
self.delayed_calls.append
meross_iot.http_api.MerossHttpClient.async_from_cloud_creds
meross_iot.utilities.mqtt.device_uuid_from_push_notification
self._async_send_and_wait_ack
self._update_channel_status
MerossHttpClient
data.copy.get
creds.to_json.encode.base64.b64encode.decode
self._error_budget_manager.notify_error
json.loads.decode
self._loop.call_soon_threadsafe
cached_type
self.get_subdevice.async_handle_subdevice_notification
asyncio.set_event_loop_policy
asyncio.wait_for
re.compile
time.time
range
http_subdevice_info.to_dict
logging.getLogger.addHandler
self.is_on
delayed_execution
vars
self.async_turn_on
parser.parse_args.func
authenticated_command_executor
self._by_api_response_code.items
self._hub._execute_command.get
asyncio.run_coroutine_threadsafe
filter.extend
self.async_execute_cmd.get
collections.deque
self.async_fetch_config
logging.getLogger.getChild
_encode_params
light_payload.get
auth_subparsers.add_parser.set_defaults
livereload.Server
meross_iot.model.enums.OnlineStatus
_ABILITY_MATRIX.get
self._devices_by_internal_id.get.async_update
url.lower.startswith

@developer Could please help me check this issue? May I pull a request to fix it? Thank you very much.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.