Skip to content

Commit

Permalink
Bugfix/remove null appinfo (#15)
Browse files Browse the repository at this point in the history
* remove null appinfo from event for bugit

* remove null appinfo in a correct way
  • Loading branch information
yumiguan authored Oct 22, 2018
1 parent 0b84bb1 commit 1c3e6e7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions lyrebird_ios/device_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,25 @@ def start_log_recorder(self, device_id):
def publish_devices_info_event(self, online_devices):
devices = []
for item in online_devices:
info = online_devices[item]
app = online_devices[item].get_app_info(self.get_default_app_name())
devices.append(
{
'id': info.device_id,
'info': {
'name': info.device_name,
'model': info.model,
'os': info.os_version,
'sn': info.sn
},
'app': {
'name': app['AppName'],
'version': app['VersionNumber'],
'build': app['BuildNumber'],
'bundleID': app['BundleID']
}
device_info = online_devices[item]
app_info = online_devices[item].get_app_info(self.get_default_app_name())
message_info = {
'id': device_info.device_id,
'info': {
'name': device_info.device_name,
'model': device_info.model,
'os': device_info.os_version,
'sn': device_info.sn
},
}
if app_info.get('AppName'):
message_info['app'] = {
'name': app_info['AppName'],
'version': app_info['VersionNumber'],
'build': app_info['BuildNumber'],
'bundleID': app_info['BundleID']
}
)
devices.append(message_info)
lyrebird.publish('ios.device', devices, state=True)

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='lyrebird-ios',
version='0.1.12',
version='0.1.13',
packages=['lyrebird_ios'],
url='https://github.com/meituan/lyrebird-ios',
author='HBQA',
Expand Down

0 comments on commit 1c3e6e7

Please sign in to comment.