Skip to content
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

PIOT-CDA-02-004: Create / edit module - BaseSystemUtilTask #68

Open
labbenchstudios opened this issue Sep 18, 2020 · 0 comments
Open

PIOT-CDA-02-004: Create / edit module - BaseSystemUtilTask #68

labbenchstudios opened this issue Sep 18, 2020 · 0 comments
Labels
exercise New feature to implement as an exercise
Milestone

Comments

@labbenchstudios
Copy link
Contributor

labbenchstudios commented Sep 18, 2020

Description

  • Create (edit) a new Python module named BaseSystemUtilTask with class name BaseSystemUtilTask. This will be in the ./programmingtheiot/cda/system package.
    • NOTE: The downloaded code repository will contain a shell implementation of this module for you to work with, or you can create your own if you'd prefer.

Review the README

  • Please see README.md for further information on, and use of, this content.
  • License for embedded documentation and source codes: PIOT-DOC-LIC

Estimated effort may vary greatly

  • The estimated level of effort for this exercise shown in the 'Estimate' section below is a very rough approximation. The actual level of effort may vary greatly depending on your development and test environment, experience with the requisite technologies, and many other factors.

Actions

NOTE: The implementation examples depicted here are only one way to implement the requirements listed. Your own implementation may vary of course.

  • Add a constructor that accepts a name (str) and typeID (int), and sets class-scoped variables of the same names. The defaults for each can be name = ConfigConst.NOT_SET and typeID = ConfigConst.DEFAULT_SENSOR_TYPE
  • Add a getter method for each of self.name and self.typeID. These two methods should simply return the values, as follows:
def __init__(self, name: str = ConfigConst.NOT_SET, typeID: int = ConfigConst.DEFAULT_SENSOR_TYPE):
	self.name = name
	self.typeID = typeID

def getName(self) -> str:
	return self.name

def getTypeID(self) -> int:
	return self.typeID
  • Add a template method definition for getTelemetryValue() as follows:
def getTelemetryValue() -> float:
    pass
  • Why the pass? This is just a template method, and will be implemented by the sub-class

Estimate

  • Small

Tests

  • For this base class, there are no tests to run.
@labbenchstudios labbenchstudios added the exercise New feature to implement as an exercise label Sep 18, 2020
@labbenchstudios labbenchstudios added this to the Chapter 02 milestone Sep 18, 2020
@labbenchstudios labbenchstudios added this to Chapter 2 - Create Initial Apps in Programming the IoT - Exercises Kanban Board Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exercise New feature to implement as an exercise
Projects
Programming the IoT - Exercises Kanba...
  
Lab Module 02 - Edge Tier Apps
Development

No branches or pull requests

1 participant