-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make em mow #54
Merged
Merged
Make em mow #54
Changes from 16 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
9c0f6a5
start work on mowing
mikey0000 9ca6997
update mtrl nav
mikey0000 a3e6718
fix nav commands for none luba 1s
mikey0000 2ec41cf
ruff format and so on
mikey0000 0194180
add product key to commands for checking device
mikey0000 7e13f96
fix blade on off
mikey0000 6f0b578
Try to implement MQTT response - Need helo on Lock
0de6ccd
update protobufs with basestation
mikey0000 994ceb0
adding report info model and map conversions for lla enu
mikey0000 79e05f6
release 0.1.7
mikey0000 ede5f06
try to keep last data if its missing in report cfg
mikey0000 39867b5
fix report info
mikey0000 41a24cc
Merge branch 'make-em-mow' into make-em-mow
mikey0000 21011b6
Add missing calls for ble sync as well as hook up callbacks, remove d…
mikey0000 256f822
format and run ruff
mikey0000 a88ef95
add cloud as part of base MammotionDevice
mikey0000 cf89c0b
rename http class
mikey0000 bc87dd4
fix up the client sesion for http
mikey0000 d366e23
update login to login_info
mikey0000 0145abd
bump version to 0.2.1
mikey0000 1bd8261
add start sync and sync maps calls to MammotionDevice
mikey0000 198ba02
refactor mammotion to handle multiple devices and match to a name
mikey0000 2734378
update test examples
mikey0000 de8d1f1
fix oops
mikey0000 511bfbf
fix quite a few errors and issues
mikey0000 3bfb15e
stability improvements
mikey0000 1234714
fix more issues
mikey0000 5e13d6d
adding movement commands
mikey0000 24d3bfa
fix issue with device identification messing up sync maps
mikey0000 a12e913
remove operation lock for mqtt
mikey0000 f4e852f
publish 0.2.7
mikey0000 2f96392
Add check and refresh token into send_cloud_command (#56)
d3dfantasy99 32d3ba9
add methods for getting credentials for storing in HA when reloading …
mikey0000 a09869b
fix queuing of requests for mqtt, sync maps now works bump version to…
mikey0000 f563646
don't create cloud or initiate cloud connection if there isn't creden…
mikey0000 1297564
bump version to 0.2.11 and catch small issue with futures queue being…
mikey0000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from dataclasses import dataclass | ||
|
||
|
||
@dataclass | ||
class Credentials: | ||
email: str | ||
password: str | ||
account_id: str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from dataclasses import dataclass | ||
|
||
|
||
@dataclass | ||
class DeviceLimits: | ||
blade_height_min: int | ||
blade_height_max: int | ||
working_speed_min: float | ||
working_speed_max: float |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
from dataclasses import asdict, dataclass, field | ||
|
||
|
||
@dataclass | ||
class ConnectData: | ||
connect_type: int = 0 | ||
ble_rssi: int = 0 | ||
wifi_rssi: int = 0 | ||
|
||
@classmethod | ||
def from_dict(cls, data: dict): | ||
return cls( | ||
connect_type=data.get("connect_type", 0), | ||
ble_rssi=data.get("ble_rssi", 0), | ||
wifi_rssi=data.get("wifi_rssi", 0), | ||
) | ||
|
||
|
||
@dataclass | ||
class DeviceData: | ||
sys_status: int = 0 | ||
charge_state: int = 0 | ||
battery_val: int = 0 | ||
sensor_status: int = 0 | ||
last_status: int = 0 | ||
sys_time_stamp: str = "" | ||
|
||
@classmethod | ||
def from_dict(cls, data: dict): | ||
return cls( | ||
sys_status=data.get("sys_status", 0), | ||
charge_state=data.get("charge_state", 0), | ||
battery_val=data.get("battery_val", 0), | ||
sensor_status=data.get("sensor_status", 0), | ||
last_status=data.get("last_status", 0), | ||
sys_time_stamp=data.get("sys_time_stamp", ""), | ||
) | ||
|
||
|
||
@dataclass | ||
class RTKData: | ||
status: int = 0 | ||
pos_level: int = 0 | ||
gps_stars: int = 0 | ||
dis_status: str = "" | ||
co_view_stars: int = 0 | ||
|
||
@classmethod | ||
def from_dict(cls, data: dict): | ||
return cls( | ||
status=data.get("status", 0), | ||
pos_level=data.get("pos_level", 0), | ||
gps_stars=data.get("gps_stars", 0), | ||
dis_status=data.get("dis_status", ""), | ||
co_view_stars=data.get("co_view_stars", 0), | ||
) | ||
|
||
|
||
@dataclass | ||
class LocationData: | ||
real_pos_x: int = 0 | ||
real_pos_y: int = 0 | ||
real_toward: int = 0 | ||
pos_type: int = 0 | ||
bol_hash: str = "" | ||
|
||
@classmethod | ||
def from_dict(cls, data: dict): | ||
return cls( | ||
real_pos_x=data.get("real_pos_x", 0), | ||
real_pos_y=data.get("real_pos_y", 0), | ||
real_toward=data.get("real_toward", 0), | ||
pos_type=data.get("pos_type", 0), | ||
bol_hash=data.get("bol_hash", ""), | ||
) | ||
|
||
|
||
@dataclass | ||
class WorkData: | ||
path: int = 0 | ||
path_hash: str = "" | ||
progress: int = 0 | ||
area: int = 0 | ||
bp_info: int = 0 | ||
bp_hash: str = "" | ||
bp_pos_x: int = 0 | ||
bp_pos_y: int = 0 | ||
real_path_num: str = "" | ||
path_pos_x: int = 0 | ||
path_pos_y: int = 0 | ||
ub_zone_hash: str = "" | ||
ub_path_hash: str = "" | ||
init_cfg_hash: str = "" | ||
ub_ecode_hash: str = "" | ||
nav_run_mode: int = 0 | ||
test_mode_status: int = 0 | ||
man_run_speed: int = 0 | ||
nav_edit_status: int = 0 | ||
knife_height: int = 0 | ||
|
||
@classmethod | ||
def from_dict(cls, data: dict): | ||
return cls( | ||
path=data.get("path", 0), | ||
path_hash=data.get("path_hash", ""), | ||
progress=data.get("progress", 0), | ||
area=data.get("area", 0), | ||
bp_info=data.get("bp_info", 0), | ||
bp_hash=data.get("bp_hash", ""), | ||
bp_pos_x=data.get("bp_pos_x", 0), | ||
bp_pos_y=data.get("bp_pos_y", 0), | ||
real_path_num=data.get("real_path_num", ""), | ||
path_pos_x=data.get("path_pos_x", 0), | ||
path_pos_y=data.get("path_pos_y", 0), | ||
ub_zone_hash=data.get("ub_zone_hash", ""), | ||
ub_path_hash=data.get("ub_path_hash", ""), | ||
init_cfg_hash=data.get("init_cfg_hash", ""), | ||
ub_ecode_hash=data.get("ub_ecode_hash", ""), | ||
nav_run_mode=data.get("nav_run_mode", 0), | ||
test_mode_status=data.get("test_mode_status", 0), | ||
man_run_speed=data.get("man_run_speed", 0), | ||
nav_edit_status=data.get("nav_edit_status", 0), | ||
knife_height=data.get("knife_height", 0), | ||
) | ||
|
||
|
||
@dataclass | ||
class ReportData: | ||
connect: ConnectData = field(default_factory=ConnectData) | ||
dev: DeviceData = field(default_factory=DeviceData) | ||
rtk: RTKData = field(default_factory=RTKData) | ||
locations: list[LocationData] = field(default_factory=list) | ||
work: WorkData = field(default_factory=WorkData) | ||
|
||
def from_dict(self, data: dict): | ||
locations = self.locations | ||
if data.get("locations") is not None: | ||
locations = [LocationData.from_dict(loc) for loc in data.get("locations", [])] | ||
|
||
return ReportData( | ||
connect=ConnectData.from_dict(data.get("connect", asdict(self.connect))), | ||
dev=DeviceData.from_dict(data.get("dev", asdict(self.dev))), | ||
rtk=RTKData.from_dict(data.get("rtk", asdict(self.rtk))), | ||
locations=locations, | ||
work=WorkData.from_dict(data.get("work", asdict(self.work))), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update to blade height