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

MCP23XXX Refactor #1560

Merged
merged 2 commits into from
Mar 7, 2021
Merged

MCP23XXX Refactor #1560

merged 2 commits into from
Mar 7, 2021

Conversation

jesserockz
Copy link
Member

@jesserockz jesserockz commented Feb 22, 2021

Description:

This refactors the MCP23008, MCP23017, MCP23S08 and MCP23S17 to remove duplicate code and inherit from new base classes.

It also removes the duplicate pin schemas and consolidates all 4 into a single new schema with key mcp23xxx for the component id.

Related issue (if applicable): fixes

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#1028

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@probot-esphome
Copy link

Hey there @SenexCrenshaw, mind taking a look at this pull request as its been labeled with an integration (mcp23S17) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@kbx81
Copy link
Member

kbx81 commented Feb 28, 2021

@jesserockz this is looking good! I want to test it out but time keeps getting away from me. I rolled through the code, though, and I like how you've (re)arranged things. 😄

Copy link
Member

@glmnet glmnet left a comment

Choose a reason for hiding this comment

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

This pr has lots of changes with files with almost the same name and reviewing file changes with just formattings is quite annoying waste of time. I've seen other people already do this and asked him to rollback the format change, I'm ok with a formatter update on the codebase but that will be another PR

@jesserockz
Copy link
Member Author

This pr has lots of changes with files with almost the same name and reviewing file changes with just formattings is quite annoying waste of time. I've seen other people already do this and asked him to rollback the format change, I'm ok with a formatter update on the codebase but that will be another PR

Yeah sorry, I just ran black mcp*

@probot-esphome
Copy link

probot-esphome bot commented Mar 7, 2021

Hey there @SenexCrenshaw, mind taking a look at this pull request as its been labeled with an integration (mcp23S17) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@glmnet glmnet merged commit 570ec36 into dev Mar 7, 2021
@glmnet glmnet deleted the mcp23xxx/rewrite branch March 7, 2021 19:23
taquitos pushed a commit to taquitos/esphome that referenced this pull request Mar 14, 2021
* Refactor MCP23XXX classes to consolidate shared code

* Update test mcp23xxx pin schemas
This was referenced Mar 22, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants