Skip to content

Conversation

@okdtsk
Copy link
Member

@okdtsk okdtsk commented Apr 26, 2017

Support device message from LINE beacon.
spec: https://devdocs.line.me/en/#webhook-event-object

@okdtsk
Copy link
Member Author

okdtsk commented Apr 26, 2017

As of 2017/4/26, flake8-docstrings has dependency issue related pydocstyle.
So test py35-flake8-src will be failed but #39 will fix this problem.


self.type = type
self.hwid = hwid
self.dm = bytearray.fromhex(dm) if dm is not None else None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using device_message instead of dm.
Other SDK adopt device_message(or deviceMessage)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review 🌱 I agree with your suggestion, I'll change that property's name.

@okdtsk
Copy link
Member Author

okdtsk commented Apr 27, 2017

I add another test when there is no 'dm' key inside webhook's json.

@be-hase
Copy link
Member

be-hase commented Apr 27, 2017

LGTM 👍

@okdtsk
Copy link
Member Author

okdtsk commented Apr 27, 2017

@be-hase Thanks! I rebased this feature branch onto master (for #39) and squashed into one commit.

@okdtsk
Copy link
Member Author

okdtsk commented Apr 27, 2017

I found a failed test py35-flake8-other due to E501 - line too long at examples/flask-kitchensink/app.py:253:100, so fixed it.

diff --git c/examples/flask-kitchensink/app.py w/examples/flask-kitchensink/app.py
index b104be5..f6f2d7f 100644
--- c/examples/flask-kitchensink/app.py
+++ w/examples/flask-kitchensink/app.py
@@ -250,7 +250,8 @@ def handle_postback(event):
 def handle_beacon(event):
     line_bot_api.reply_message(
         event.reply_token,
-        TextSendMessage(text='Got beacon event. hwid={}, device_message={}'.format(event.beacon.hwid, event.beacon.device_message)))
+        TextSendMessage(text='Got beacon event. hwid={}, device_message={}'
+                             .format(event.beacon.hwid, event.beacon.device_message)))


 if __name__ == "__main__":

@be-hase be-hase merged commit 969690b into line:master Apr 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants